org.apache.jackrabbit.mk.util
Class ChunkedInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
org.apache.jackrabbit.mk.util.ChunkedInputStream
- All Implemented Interfaces:
- Closeable
public class ChunkedInputStream
- extends FilterInputStream
Input stream that reads and decodes HTTP chunks, assuming that no chunk
exceeds 32768 bytes and that a chunk's length is represented by exactly 4
hexadecimal characters.
|
Method Summary |
void |
close()
Close this input stream. |
int |
read()
|
int |
read(byte[] b,
int off,
int len)
|
void |
recycle(InputStream in)
Recycle this input stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MAX_CHUNK_SIZE
public static final int MAX_CHUNK_SIZE
- Maximum chunk size.
- See Also:
- Constant Field Values
ChunkedInputStream
public ChunkedInputStream(InputStream in)
- Create a new instance of this class.
- Parameters:
in - input stream
read
public int read()
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
read
public int read(byte[] b,
int off,
int len)
throws IOException
- Overrides:
read in class FilterInputStream
- Throws:
IOException
recycle
public void recycle(InputStream in)
- Recycle this input stream.
- Parameters:
in - new underlying input stream
close
public void close()
throws IOException
- Close this input stream. Finishes reading any pending chunks until
the last chunk is received. Does not close the underlying input
stream.
- Specified by:
close in interface Closeable- Overrides:
close in class FilterInputStream
- Throws:
IOException- See Also:
FilterInputStream.close()
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.