B
Ben
Hi,
I'm using Inputstream to read an HTTP request from my browser (i'm
actually making a proxy).
The code:
InputStream in = new DataInputStream(socket.getInputStream());
ArrayList<Integer> byteArray = new ArrayList<Integer>();
int currByte=in.read();
while (currByte!=-1){ // Reading byte until -1 is reached
byteArray.add(new Integer(currByte));
System.out.print((char)currByte);
currByte = in.read();
}
For some reason, instead of recognizing the end of the request and
returning -1 InputStream.read() blocks forever.
Am i doing something wrong??
Thanks,
Ben.
I'm using Inputstream to read an HTTP request from my browser (i'm
actually making a proxy).
The code:
InputStream in = new DataInputStream(socket.getInputStream());
ArrayList<Integer> byteArray = new ArrayList<Integer>();
int currByte=in.read();
while (currByte!=-1){ // Reading byte until -1 is reached
byteArray.add(new Integer(currByte));
System.out.print((char)currByte);
currByte = in.read();
}
For some reason, instead of recognizing the end of the request and
returning -1 InputStream.read() blocks forever.
Am i doing something wrong??
Thanks,
Ben.