public final class SnappyFramedInputStream
extends java.io.InputStream
implements java.nio.channels.ReadableByteChannel
| Modifier and Type | Class and Description |
|---|---|
static class |
SnappyFramedInputStream.FrameData |
static class |
SnappyFramedInputStream.FrameMetaData |
| Constructor and Description |
|---|
SnappyFramedInputStream(java.io.InputStream in)
Creates a Snappy input stream to read data from the specified underlying
input stream.
|
SnappyFramedInputStream(java.io.InputStream in,
boolean verifyChecksums)
Creates a Snappy input stream to read data from the specified underlying
input stream.
|
SnappyFramedInputStream(java.nio.channels.ReadableByteChannel in)
Creates a Snappy input stream to read data from the specified underlying
channel.
|
SnappyFramedInputStream(java.nio.channels.ReadableByteChannel in,
boolean verifyChecksums)
Creates a Snappy input stream to read data from the specified underlying
channel.
|
| Modifier and Type | Method and Description |
|---|---|
int |
available() |
void |
close() |
boolean |
isOpen() |
int |
read() |
int |
read(byte[] output,
int offset,
int length) |
int |
read(java.nio.ByteBuffer dst) |
long |
transferTo(java.io.OutputStream os)
Transfers the entire content of this
InputStream to os. |
long |
transferTo(java.nio.channels.WritableByteChannel wbc)
Transfers the entire content of this
ReadableByteChannel to
wbc. |
public SnappyFramedInputStream(java.io.InputStream in)
throws java.io.IOException
in - the underlying input stream. Must not be null.java.io.IOExceptionpublic SnappyFramedInputStream(java.io.InputStream in,
boolean verifyChecksums)
throws java.io.IOException
in - the underlying input stream. Must not be null.verifyChecksums - if true, checksums in input stream will be verifiedjava.io.IOExceptionpublic SnappyFramedInputStream(java.nio.channels.ReadableByteChannel in)
throws java.io.IOException
in - the underlying readable channel. Must not be null.java.io.IOExceptionpublic SnappyFramedInputStream(java.nio.channels.ReadableByteChannel in,
boolean verifyChecksums)
throws java.io.IOException
in - the underlying readable channel. Must not be null.verifyChecksums - if true, checksums in input stream will be verifiedjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int read(byte[] output,
int offset,
int length)
throws java.io.IOException
read in class java.io.InputStreamjava.io.IOExceptionpublic int available()
throws java.io.IOException
available in class java.io.InputStreamjava.io.IOExceptionpublic boolean isOpen()
isOpen in interface java.nio.channels.Channelpublic int read(java.nio.ByteBuffer dst)
throws java.io.IOException
read in interface java.nio.channels.ReadableByteChanneljava.io.IOExceptionpublic long transferTo(java.io.OutputStream os)
throws java.io.IOException
InputStream to os.
This potentially limits the amount of buffering required to decompress
content.
Unlike read(byte[], int, int), this method does not need to be
called multiple times. A single call will transfer all available content.
Any calls after the source has been exhausted will result in a return
value of 0.
os - The destination to write decompressed content to.java.io.IOExceptionpublic long transferTo(java.nio.channels.WritableByteChannel wbc)
throws java.io.IOException
ReadableByteChannel to
wbc. This potentially limits the amount of buffering required to
decompress content.
Unlike read(ByteBuffer), this method does not need to be called
multiple times. A single call will transfer all available content. Any
calls after the source has been exhausted will result in a return value
of 0.
wbc - The destination to write decompressed content to.java.io.IOExceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in interface java.nio.channels.Channelclose in class java.io.InputStreamjava.io.IOException