ProProxy Home

proproxy
Class ProHTTPCompressInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--proproxy.ProHTTPCompressInputStream

public class ProHTTPCompressInputStream
extends java.io.InputStream

ProHTTPCompressInputStream
Encapsulates the actual HTTP connection between the Proxy and the WebServer. Handles header modification and compression of data transparently.
You are free to use this code and to make modifications provided this notice is retained.

If you found this useful, please add a note of acknowledgement to my guestbook. If you would like to report a bug or suggest some improvements, you are most welcome. I will be happy to help you use this piece of code.

Version:
1.00, 10th Mar, 2000
Author:
Tanmay K. Mohapatra

Constructor Summary
ProHTTPCompressInputStream(java.io.InputStream BaseStreamIn, ProHTTPCompressStatus ComprStatusIn)
           
 
Method Summary
 int read()
          Wrapper read function that parses and modifies the underlying stream also.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProHTTPCompressInputStream

public ProHTTPCompressInputStream(java.io.InputStream BaseStreamIn,
                                  ProHTTPCompressStatus ComprStatusIn)
Method Detail

read

public int read()
         throws java.io.IOException
Wrapper read function that parses and modifies the underlying stream also. Read from the underlying stream. Write to the StringBuffer. When a new-line is obtained, check if the header is a Content-Encoding header. If yes, check in ComprStatus and modify it if required. If the header is a content-length header, read the whole output and store it in a local buffer. Henceforth, give from local buffer. If no intervention is required, ignore all the above and return whatever the base stream returns.
Overrides:
read in class java.io.InputStream

ProProxy Home