com.partnersoft.v3x.io
Class BufferPoolingInflaterInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.util.zip.InflaterInputStream
              extended by com.partnersoft.v3x.io.BufferPoolingInflaterInputStream
All Implemented Interfaces:
java.io.Closeable

public class BufferPoolingInflaterInputStream
extends java.util.zip.InflaterInputStream

An implementation of InflaterInputStream that utilizes pooled buffers. Presumably this makes it more efficient (both memory and speed). Unfortunately, java.util.zip.InflaterInputStream does not have a constructor that allows me to skip allocating their buffer, so I just allocate a single byte one. Maybe that doesn't screw us up, who knows.


Field Summary
 
Fields inherited from class java.util.zip.InflaterInputStream
buf, inf, len
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
BufferPoolingInflaterInputStream(java.io.InputStream innie)
           
BufferPoolingInflaterInputStream(java.io.InputStream innie, java.util.zip.Inflater inflater)
           
 
Method Summary
 void close()
           
protected  byte[] getBuffer()
          Used by CompressionSwitchingInputStream.
protected  java.util.zip.Inflater getInflater()
          Used by CompressionSwitchingInputStream.
 
Methods inherited from class java.util.zip.InflaterInputStream
available, fill, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.io.FilterInputStream
read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferPoolingInflaterInputStream

public BufferPoolingInflaterInputStream(java.io.InputStream innie)

BufferPoolingInflaterInputStream

public BufferPoolingInflaterInputStream(java.io.InputStream innie,
                                        java.util.zip.Inflater inflater)
Method Detail

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.util.zip.InflaterInputStream
Throws:
java.io.IOException

getBuffer

protected byte[] getBuffer()
Used by CompressionSwitchingInputStream.


getInflater

protected java.util.zip.Inflater getInflater()
Used by CompressionSwitchingInputStream.