Class ZIP
java.lang.Object
org.apache.sis.internal.storage.inflater.PixelChannel
org.apache.sis.internal.storage.inflater.CompressionChannel
org.apache.sis.internal.storage.inflater.ZIP
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Channel
,ReadableByteChannel
Inflater for values encoded with the "Deflate" compression.
- Since:
- 1.1
- Version:
- 1.3
-
Field Summary
FieldsFields inherited from class org.apache.sis.internal.storage.inflater.CompressionChannel
input, listeners
-
Constructor Summary
ConstructorsConstructorDescriptionZIP
(ChannelDataInput input, StoreListeners listeners) Creates a new channel which will decompress data from the given input. -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Releases resources used by the inflater.private int
inflate
(ByteBuffer target) Placeholder forInflater.inflate(ByteBuffer)
.int
read
(ByteBuffer target) Decompresses some bytes from the input into the given destination buffer.private void
setInput
(ByteBuffer target) Placeholder forInflater.setInput(ByteBuffer)
.void
setInputRegion
(long start, long byteCount) Prepares this inflater for reading a new tile or a new band of a tile.Methods inherited from class org.apache.sis.internal.storage.inflater.CompressionChannel
createDataInput, finished, isOpen, repeat, resources
-
Field Details
-
inflater
Access to the ZLIB compression library. Must be released by call toInflater.end()
after decompression is completed.
-
-
Constructor Details
-
ZIP
Creates a new channel which will decompress data from the given input. ThesetInputRegion(long, long)
method must be invoked after construction before a reading process can start.- Parameters:
input
- the source of data to decompress.listeners
- object where to report warnings.start
- stream position where to start reading.byteCount
- number of bytes to read from the input.- Throws:
IOException
- if the stream cannot be seek to the given start position.
-
-
Method Details
-
setInputRegion
Prepares this inflater for reading a new tile or a new band of a tile.- Overrides:
setInputRegion
in classCompressionChannel
- Parameters:
start
- stream position where to start reading.byteCount
- number of bytes to read from the input.- Throws:
IOException
- if the stream cannot be seek to the given start position.
-
read
Decompresses some bytes from the input into the given destination buffer.- Parameters:
target
- the buffer into which bytes are to be transferred.- Returns:
- the number of bytes read, or -1 if end-of-stream.
- Throws:
IOException
- if some other I/O error occurs.
-
inflate
Placeholder forInflater.inflate(ByteBuffer)
.- Throws:
DataFormatException
-
setInput
Placeholder forInflater.setInput(ByteBuffer)
.- Throws:
DataFormatException
-
close
public void close()Releases resources used by the inflater.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceChannel
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classCompressionChannel
-