org.jboss.resteasy.client.core
Class SelfExpandingBufferredInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by java.io.FilterInputStream
          extended by java.io.BufferedInputStream
              extended by org.jboss.resteasy.client.core.SelfExpandingBufferredInputStream
All Implemented Interfaces:
java.io.Closeable

public class SelfExpandingBufferredInputStream
extends java.io.BufferedInputStream

Extension of BufferedInputStream enforcing the contract where reset() always returns to the beginning of the stream, and the internal buffer expands automatically to the total length of content read from the underlying stream.

Author:
ul8b

Field Summary
 
Fields inherited from class java.io.BufferedInputStream
buf, count, marklimit, markpos, pos
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
SelfExpandingBufferredInputStream(java.io.InputStream in)
           
SelfExpandingBufferredInputStream(java.io.InputStream in, int size)
           
 
Method Summary
 int getBufSize()
          Return the current maximum size of the internal buffer.
 int getCount()
           
 int getMarkLimit()
           
 int getMarkPos()
           
 int getPos()
           
 void mark(int readlimit)
          Not supported.
 int read()
           
 int read(byte[] b)
           
 int read(byte[] b, int off, int len)
           
 
Methods inherited from class java.io.BufferedInputStream
available, close, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelfExpandingBufferredInputStream

public SelfExpandingBufferredInputStream(java.io.InputStream in)

SelfExpandingBufferredInputStream

public SelfExpandingBufferredInputStream(java.io.InputStream in,
                                         int size)
Method Detail

mark

public void mark(int readlimit)
Not supported. Mark position is always zero.

Overrides:
mark in class java.io.BufferedInputStream

read

public int read()
         throws java.io.IOException
Overrides:
read in class java.io.BufferedInputStream
Throws:
java.io.IOException

read

public int read(byte[] b,
                int off,
                int len)
         throws java.io.IOException
Overrides:
read in class java.io.BufferedInputStream
Throws:
java.io.IOException

read

public int read(byte[] b)
         throws java.io.IOException
Overrides:
read in class java.io.FilterInputStream
Throws:
java.io.IOException

getBufSize

public int getBufSize()
Return the current maximum size of the internal buffer. This is independent of how much data is actually contained within the buffer.


getCount

public int getCount()

getPos

public int getPos()

getMarkLimit

public int getMarkLimit()

getMarkPos

public int getMarkPos()


Copyright © 2010. All Rights Reserved.