Class SelfExpandingBufferredInputStream
- java.lang.Object
-
- java.io.InputStream
-
- java.io.FilterInputStream
-
- java.io.BufferedInputStream
-
- org.jboss.resteasy.client.jaxrs.engines.SelfExpandingBufferredInputStream
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class SelfExpandingBufferredInputStream extends BufferedInputStream
Extension ofBufferedInputStream
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.FilterInputStream
in
-
-
Constructor Summary
Constructors Constructor Description SelfExpandingBufferredInputStream(InputStream in)
SelfExpandingBufferredInputStream(InputStream in, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
Constructor Detail
-
SelfExpandingBufferredInputStream
public SelfExpandingBufferredInputStream(InputStream in)
-
SelfExpandingBufferredInputStream
public SelfExpandingBufferredInputStream(InputStream in, int size)
-
-
Method Detail
-
mark
public void mark(int readlimit)
Not supported. Mark position is always zero.- Overrides:
mark
in classBufferedInputStream
-
read
public int read() throws IOException
- Overrides:
read
in classBufferedInputStream
- Throws:
IOException
-
read
public int read(byte[] b, int off, int len) throws IOException
- Overrides:
read
in classBufferedInputStream
- Throws:
IOException
-
read
public int read(byte[] b) throws IOException
- Overrides:
read
in classFilterInputStream
- Throws:
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.- Returns:
- internal buffer size
-
getCount
public int getCount()
-
getPos
public int getPos()
-
getMarkLimit
public int getMarkLimit()
-
getMarkPos
public int getMarkPos()
-
-