Class ZstdDecompressReadableChunkChannel
java.lang.Object
com.e1c.g5.v8.internal.fastzip.chunk.ZstdDecompressReadableChunkChannel
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,ReadableByteChannel
A channel which reads Zstandard compressed data from a sequence of chunks provided by
IChunkSupplier
and decompresses it.
The source data must originate from ZstdCompressWritableChunkChannel
. Chunk bounds must be preserved.
Due to limitations of zstd-jni
the source byte buffers provided by the chunk supplier
must be direct. As any respectful channel's read, read(ByteBuffer)
of this channel accepts indirect
byte buffers as well as direct ones, but a slight performance penalty is expected for indirect byte buffers
because of additional coping.
-
Constructor Summary
ConstructorsConstructorDescriptionZstdDecompressReadableChunkChannel
(IChunkSupplier chunkSupplier) Constructs a new channel. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
close()
final boolean
isOpen()
int
read
(ByteBuffer dst)
-
Constructor Details
-
ZstdDecompressReadableChunkChannel
Constructs a new channel.- Parameters:
chunkSupplier
- the chunk supplier, must provide direct byte buffers, cannot benull
-
-
Method Details
-
read
- Specified by:
read
in interfaceReadableByteChannel
- Throws:
IOException
-
isOpen
public final boolean isOpen() -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-