Top Inners Fields Constructors Methods
org.bouncycastle.cms.jcajce

public Class ZlibExpanderProvider

extends Object
implements InputExpanderProvider
Class Inheritance
All Implemented Interfaces
org.bouncycastle.operator.InputExpanderProvider
Imports
java.io.FilterInputStream, .IOException, .InputStream, java.util.zip.InflaterInputStream, org.bouncycastle.asn1.x509.AlgorithmIdentifier, org.bouncycastle.operator.InputExpander, .InputExpanderProvider, org.bouncycastle.util.io.StreamOverflowException

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private final long

Constructor Summary

AccessConstructor and Description
public
ZlibExpanderProvider()

Base constructor.

public
ZlibExpanderProvider(long
max number of bytes allowed in an expanded stream.
limit
)

Create a provider which caps the number of expanded bytes that can be produced when the compressed stream is parsed.

Method Summary

Modifier and TypeMethod and Description
public InputExpander
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

limitback to summary
private final long limit

Constructor Detail

ZlibExpanderProviderback to summary
public ZlibExpanderProvider()

Base constructor. Create an expander which will not limit the size of any objects expanded in the stream.

ZlibExpanderProviderback to summary
public ZlibExpanderProvider(long limit)

Create a provider which caps the number of expanded bytes that can be produced when the compressed stream is parsed.

Parameters
limit:long

max number of bytes allowed in an expanded stream.

Method Detail

getback to summary
public InputExpander get(final AlgorithmIdentifier algorithm)

Implements org.bouncycastle.operator.InputExpanderProvider.get.

org.bouncycastle.cms.jcajce back to summary

private Class ZlibExpanderProvider.LimitedInputStream

extends FilterInputStream
Class Inheritance

Field Summary

Modifier and TypeField and Description
private long
Inherited from java.io.FilterInputStream:
in

Constructor Summary

AccessConstructor and Description
public
LimitedInputStream(InputStream input, long limit)

Method Summary

Modifier and TypeMethod and Description
public int
read()

Overrides java.io.FilterInputStream.read.

Reads the next byte of data from the input stream.
public int
read(byte[]
the buffer into which the data is read.
buf
,
int
the start offset in array b at which the data is written.
off
,
int
the maximum number of bytes to read.
len
)

Overrides java.io.FilterInputStream.read.

Reads up to len bytes of data from this input stream into an array of bytes.
Inherited from java.io.FilterInputStream:
availableclosemarkmarkSupportedreadresetskip

Field Detail

remainingback to summary
private long remaining

Constructor Detail

LimitedInputStreamback to summary
public LimitedInputStream(InputStream input, long limit)

Method Detail

readback to summary
public int read() throws IOException

Overrides java.io.FilterInputStream.read.

Doc from java.io.FilterInputStream.read.

Reads the next byte of data from the input stream. The value byte is returned as an int in the range 0 to 255. If no byte is available because the end of the stream has been reached, the value -1 is returned. This method blocks until input data is available, the end of the stream is detected, or an exception is thrown.

Returns:int

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

Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read(byte[] buf, int off, int len) throws IOException

Overrides java.io.FilterInputStream.read.

Doc from java.io.FilterInputStream.read.

Reads up to len bytes of data from this input stream into an array of bytes. If len is not zero, the method blocks until some input is available; otherwise, no bytes are read and 0 is returned.

Parameters
buf:byte[]

the buffer into which the data is read.

off:int

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

len:int

the maximum number of bytes to read.

Returns:int

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.

Exceptions
IOException:
if an I/O error occurs.