public final class SnappyFramedInputStream extends InputStream implements ReadableByteChannel
Modifier and Type | Class and Description |
---|---|
static class |
SnappyFramedInputStream.FrameData |
static class |
SnappyFramedInputStream.FrameMetaData |
Constructor and Description |
---|
SnappyFramedInputStream(InputStream in)
Creates a Snappy input stream to read data from the specified underlying
input stream.
|
SnappyFramedInputStream(InputStream in,
boolean verifyChecksums)
Creates a Snappy input stream to read data from the specified underlying
input stream.
|
SnappyFramedInputStream(ReadableByteChannel in)
Creates a Snappy input stream to read data from the specified underlying
channel.
|
SnappyFramedInputStream(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(ByteBuffer dst) |
long |
transferTo(OutputStream os)
Transfers the entire content of this
InputStream to os. |
long |
transferTo(WritableByteChannel wbc)
Transfers the entire content of this
ReadableByteChannel to
wbc. |
mark, markSupported, read, reset, skip
public SnappyFramedInputStream(InputStream in) throws IOException
in
- the underlying input stream. Must not be null
.IOException
public SnappyFramedInputStream(InputStream in, boolean verifyChecksums) throws IOException
in
- the underlying input stream. Must not be null
.verifyChecksums
- if true, checksums in input stream will be verifiedIOException
public SnappyFramedInputStream(ReadableByteChannel in) throws IOException
in
- the underlying readable channel. Must not be null
.IOException
public SnappyFramedInputStream(ReadableByteChannel in, boolean verifyChecksums) throws IOException
in
- the underlying readable channel. Must not be null
.verifyChecksums
- if true, checksums in input stream will be verifiedIOException
public int read() throws IOException
read
in class InputStream
IOException
public int read(byte[] output, int offset, int length) throws IOException
read
in class InputStream
IOException
public int available() throws IOException
available
in class InputStream
IOException
public int read(ByteBuffer dst) throws IOException
read
in interface ReadableByteChannel
IOException
public long transferTo(OutputStream os) throws 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.IOException
public long transferTo(WritableByteChannel wbc) throws 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.IOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in interface Channel
close
in class InputStream
IOException
Copyright © 2011–2023 xerial.org. All rights reserved.