Top Description Inners Fields Constructors Methods
org.apache.hc.client5.http.entity

public Class DeflateInputStream

extends InputStream
Class Inheritance
Imports
java.io.IOException, .InputStream, .PushbackInputStream, java.util.zip.Inflater, .InflaterInputStream, .ZipException

Deflate input stream. This class includes logic needed for various Rfc's in order to reasonably implement the "deflate" compression style.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final InputStream

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
available()

Overrides java.io.InputStream.available.

Get available.
public void
public void
mark(final int
the maximum limit of bytes that can be read before the mark position becomes invalid.
readLimit
)

Overrides java.io.InputStream.mark.

Mark.
public boolean
markSupported()

Overrides java.io.InputStream.markSupported.

Check if mark is supported.
public int
read()

Implements abstract java.io.InputStream.read.

Read a byte.
public int
read(final byte[]
the buffer into which the data is read.
b
)

Overrides java.io.InputStream.read.

Read lots of bytes.
public int
read(final byte[]
the buffer into which the data is read.
b
,
final int
the start offset in array b at which the data is written.
off
,
final int
the maximum number of bytes to read.
len
)

Overrides java.io.InputStream.read.

Read lots of specific bytes.
public void
reset()

Overrides java.io.InputStream.reset.

Reset.
public long
skip(final long
the number of bytes to be skipped.
n
)

Overrides java.io.InputStream.skip.

Skip
Inherited from java.io.InputStream:
nullInputStreamreadAllBytesreadNBytesreadNBytesskipNBytestransferTo

Field Detail

sourceStreamback to summary
private final InputStream sourceStream

Constructor Detail

DeflateInputStreamback to summary
public DeflateInputStream(final InputStream wrapped) throws IOException

Method Detail

availableback to summary
public int available() throws IOException

Overrides java.io.InputStream.available.

Get available.

Returns:int

Doc from java.io.InputStream.available.

an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking or 0 when it reaches the end of the input stream.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.InputStream.available.

if an I/O error occurs.

closeback to summary
public void close() throws IOException

Overrides java.io.InputStream.close.

Implements java.io.Closeable.close.

Close.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.InputStream.close.

if an I/O error occurs.

markback to summary
public void mark(final int readLimit)

Overrides java.io.InputStream.mark.

Mark.

Parameters
readLimit:int

Doc from java.io.InputStream.mark.

the maximum limit of bytes that can be read before the mark position becomes invalid.

Annotations
@Override
markSupportedback to summary
public boolean markSupported()

Overrides java.io.InputStream.markSupported.

Check if mark is supported.

Returns:boolean

Doc from java.io.InputStream.markSupported.

true if this stream instance supports the mark and reset methods; false otherwise.

Annotations
@Override
readback to summary
public int read() throws IOException

Implements abstract java.io.InputStream.read.

Read a byte.

Returns:int

Doc from java.io.InputStream.read.

the next byte of data, or -1 if the end of the stream is reached.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.InputStream.read.

if an I/O error occurs.

readback to summary
public int read(final byte[] b) throws IOException

Overrides java.io.InputStream.read.

Read lots of bytes.

Parameters
b:byte[]

Doc from java.io.InputStream.read.

the buffer into which the data is read.

Returns:int

Doc from java.io.InputStream.read.

the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.InputStream.read.

If the first byte cannot be read for any reason other than the end of the file, if the input stream has been closed, or if some other I/O error occurs.

readback to summary
public int read(final byte[] b, final int off, final int len) throws IOException

Overrides java.io.InputStream.read.

Read lots of specific bytes.

Parameters
b:byte[]

Doc from java.io.InputStream.read.

the buffer into which the data is read.

off:int

Doc from java.io.InputStream.read.

the start offset in array b at which the data is written.

len:int

Doc from java.io.InputStream.read.

the maximum number of bytes to read.

Returns:int

Doc from java.io.InputStream.read.

the total number of bytes read into the buffer, or -1 if there is no more data because the end of the stream has been reached.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.InputStream.read.

If the first byte cannot be read for any reason other than end of file, or if the input stream has been closed, or if some other I/O error occurs.

resetback to summary
public void reset() throws IOException

Overrides java.io.InputStream.reset.

Reset.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.InputStream.reset.

if this stream has not been marked or if the mark has been invalidated.

skipback to summary
public long skip(final long n) throws IOException

Overrides java.io.InputStream.skip.

Skip

Parameters
n:long

Doc from java.io.InputStream.skip.

the number of bytes to be skipped.

Returns:long

Doc from java.io.InputStream.skip.

the actual number of bytes skipped which might be zero.

Annotations
@Override
Exceptions
IOException:

Doc from java.io.InputStream.skip.

if an I/O error occurs.

org.apache.hc.client5.http.entity back to summary

pack-priv Class DeflateInputStream.DeflateStream

extends InflaterInputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
Inherited from java.util.zip.InflaterInputStream:
bufinflen

Constructor Summary

AccessConstructor and Description
public
DeflateStream(final InputStream in, final Inflater inflater)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides java.util.zip.InflaterInputStream.close.

Implements java.io.Closeable.close.

Closes this input stream and releases any system resources associated with the stream.
Inherited from java.util.zip.InflaterInputStream:
availablefillmarkmarkSupportedreadreadresetskip

Field Detail

closedback to summary
private boolean closed

Hides java.util.zip.InflaterInputStream.closed.

Constructor Detail

DeflateStreamback to summary
public DeflateStream(final InputStream in, final Inflater inflater)

Method Detail

closeback to summary
public void close() throws IOException

Overrides java.util.zip.InflaterInputStream.close.

Implements java.io.Closeable.close.

Doc from java.util.zip.InflaterInputStream.close.

Closes this input stream and releases any system resources associated with the stream.

Annotations
@Override
Exceptions
IOException:
if an I/O error has occurred