S
steven
Okay, you have this line in the code to begin with
InputStream socketsInputStream = socket.getInputStream();
If you read off the html stream of a web page, and it utilizes gzip
encoding for the main data it server in the html page, then how do you
easily funnel the rest of the sockets data into :
BufferedReader reader = new BufferedReader(
new InputStreamReader(
new GZIPInputStream(
new FileInputStream( socketsInputStream ) ) ) );
when the socketsInputStream originally was fueling the
BufferedReader d = new BufferedReader(new
InputStreamReader(socketsInputStream),1); to get the header info from
the html server that says.
I gave it size 1 in hopes it would not peel off any more stream past
the lone \r\n that separates the html header from the data.
Problem is that the implementation of the InputStreamReader may use a
buffer that is larger than 1, so some unspecified amount of the data
after the header may have been lost from the sockets input stream.
So , what is the easy way to read the header , then read the gziped
data of the html page's stream.
Reason I ask is that I get a :
java.io.IOException: Not in GZIP format
error when I try to switch the socketsInputStream to the gzipped
enabled BufferedReader.
Make sense?
Thanks
InputStream socketsInputStream = socket.getInputStream();
If you read off the html stream of a web page, and it utilizes gzip
encoding for the main data it server in the html page, then how do you
easily funnel the rest of the sockets data into :
BufferedReader reader = new BufferedReader(
new InputStreamReader(
new GZIPInputStream(
new FileInputStream( socketsInputStream ) ) ) );
when the socketsInputStream originally was fueling the
BufferedReader d = new BufferedReader(new
InputStreamReader(socketsInputStream),1); to get the header info from
the html server that says.
I gave it size 1 in hopes it would not peel off any more stream past
the lone \r\n that separates the html header from the data.
Problem is that the implementation of the InputStreamReader may use a
buffer that is larger than 1, so some unspecified amount of the data
after the header may have been lost from the sockets input stream.
So , what is the easy way to read the header , then read the gziped
data of the html page's stream.
Reason I ask is that I get a :
java.io.IOException: Not in GZIP format
error when I try to switch the socketsInputStream to the gzipped
enabled BufferedReader.
Make sense?
Thanks