Package com.nuodb.jdbc
Class ChunkedInputStream
- java.lang.Object
-
- java.io.InputStream
-
- com.nuodb.jdbc.ChunkedInputStream
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ChunkedInputStream extends InputStream
ChunkedInputStream is a subclass of InputStream that attempts to refill itself when its internal buffer is exhausted. This allows the object that is being streamed to appear contiguous to the client, but have a smaller memory footprint. For example, this allows the server to stream blobs/clobs instead of sending the entire object, saving memory for the JDBC client.
-
-
Constructor Summary
Constructors Constructor Description ChunkedInputStream(ValueStream stream, boolean ascii)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intavailable()voidclose()voidmark(int readLimit)booleanmarkSupported()intread()The read functions read from the internal buffer, refilling when necessary.intread(byte[] buf)intread(byte[] buf, int off, int len)voidreset()longskip(long n)-
Methods inherited from class java.io.InputStream
nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
-
-
-
-
Constructor Detail
-
ChunkedInputStream
public ChunkedInputStream(ValueStream stream, boolean ascii)
-
-
Method Detail
-
markSupported
public boolean markSupported()
- Overrides:
markSupportedin classInputStream
-
available
public int available() throws IOException- Overrides:
availablein classInputStream- Throws:
IOException
-
mark
public void mark(int readLimit)
- Overrides:
markin classInputStream
-
reset
public void reset() throws IOException- Overrides:
resetin classInputStream- Throws:
IOException
-
read
public int read() throws IOExceptionThe read functions read from the internal buffer, refilling when necessary. Refilling should be invisible to the client.- Specified by:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] buf) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
read
public int read(byte[] buf, int off, int len) throws IOException- Overrides:
readin classInputStream- Throws:
IOException
-
skip
public long skip(long n) throws IOException- Overrides:
skipin classInputStream- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classInputStream- Throws:
IOException
-
-