|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.io.InputStream | +--com.adobe.acrobat.bytearray.ByteRangeInputStream
InputStream subclass that, given a ContiguousByteRange and an InputStream, streams only those bytes from the given InputStream whose offsets are delimited by the ContiguousByteRange.
Constructor Summary |
ByteRangeInputStream(java.io.InputStream stm,
ContiguousByteRange br) Create a new ByteRangeInputStream which provides only the bytes from the given InputStream at offsets contained in the given ContiguousByteRange. |
Method Summary | |
int |
available() Return the number of bytes available on this ByteRangeInputStream for the next read to return without blocking. |
void |
mark(int readlimit)
Mark the current position in this ByteRangeInputStream |
boolean |
markSupported()
Return whether or not marking is supported on this ByteRangeInputStream. |
int |
read() Read the next byte in the substream whose offset appears in this ByteRangeInputStream's associated ContiguousByteRange. |
int |
read(byte[] b,
int off, int len) Read the next len
bytes into the byte-buffer b starting at b[off] and return the
number of bytes actually read. |
void |
reset() Reset this ByteRangeInputStream back to wherever it was the last time mark was called. |
long |
skip(long n)
Skip at most n
bytes in this ByteRangeInputStream. |
Methods inherited from class java.io.InputStream |
close, read |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Constructor Detail |
public ByteRangeInputStream(java.io.InputStream stm, ContiguousByteRange br)
stm
- the InputStream, a subset of whose bytes will be provided by this
ByteRangeInputStreambr
- the ContiguousByteRange enumerating which bytes are to be read and
which are to be skippedMethod Detail |
public int available() throws java.io.IOException
public void mark(int readlimit)
readLimit
- the maximum number of bytes that will be read before the next
resetreset
, markSupported
public boolean markSupported()
mark
, reset
public int read() throws java.io.IOException
public int read(byte[] b, int off, int len) throws java.io.IOException
len
bytes into the byte-buffer b
starting at b[off]
and return the number of bytes actually read.b
- the buffer into which to read the bytesoff
- the offset in b at which to start writing the byteslen
- the maximum number of bytes to writepublic void reset() throws java.io.IOException
mark
, markSupported
public long skip(long n) throws java.io.IOException
n
bytes in this ByteRangeInputStream.n
- the number of bytes to skip
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |