Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.interactive.digitalsignature

public Class COSFilterInputStream

extends FilterInputStream
Class Inheritance
Imports
java.io.ByteArrayInputStream, .FilterInputStream, .IOException, .InputStream, java.util.Arrays, org.apache.pdfbox.io.IOUtils

A filtered stream that includes the bytes that are in the (begin,length) intervals passed in the constructor.
Author
boix_jor

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
COSFilterInputStream(InputStream in, int[] byteRange)

public
COSFilterInputStream(byte[] in, int[] byteRange)

Method Summary

Modifier and TypeMethod and Description
private void
calculateRanges(int[] byteRange)

private long
private boolean
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.
b
)

Overrides java.io.FilterInputStream.read.

Reads up to b.length bytes of data from this input stream into an array of bytes.

public int
read(byte[]
the buffer into which the data is read.
b
,
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.

public byte[]
Inherited from java.io.FilterInputStream:
availableclosemarkmarkSupportedresetskip

Field Detail

positionback to summary
private long position
rangeback to summary
private int range
rangesback to summary
private int[][] ranges

Constructor Detail

COSFilterInputStreamback to summary
public COSFilterInputStream(InputStream in, int[] byteRange)
COSFilterInputStreamback to summary
public COSFilterInputStream(byte[] in, int[] byteRange)

Method Detail

calculateRangesback to summary
private void calculateRanges(int[] byteRange)
getRemainingback to summary
private long getRemaining()
nextRangeback to summary
private boolean nextRange() throws IOException
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.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read(byte[] b) throws IOException

Overrides java.io.FilterInputStream.read.

Doc from java.io.FilterInputStream.read.

Reads up to b.length bytes of data from this input stream into an array of bytes. This method blocks until some input is available.

Parameters
b:byte[]

the buffer into which the data is 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.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
readback to summary
public int read(byte[] b, 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
b: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.

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs.
toByteArrayback to summary
public byte[] toByteArray() throws IOException