public abstract class SeekableInputStream extends ASInputStream
isClosed, isSourceClosed, resourceUsers| Constructor and Description |
|---|
SeekableInputStream() |
| Modifier and Type | Method and Description |
|---|---|
void |
decrementResourceUsers()
Method decrements number of resource users.
|
abstract long |
getOffset()
Gets offset of current byte.
|
static SeekableInputStream |
getSeekableStream(InputStream stream)
Returns InternalInputStream or ASMemoryInStream constructed from given
stream depending on stream length.
|
abstract ASInputStream |
getStream(long startOffset,
long length)
Gets substream of this stream that starts at given offset and has given
length.
|
abstract long |
getStreamLength()
Gets total length of stream.
|
void |
incrementResourceUsers()
Method increments number of resource users.
|
boolean |
isEOF() |
abstract int |
peek()
Gets next byte without reading it.
|
byte |
readByte()
Reads next byte from stream.
|
abstract void |
seek(long offset)
Goes to a particular byte in stream.
|
void |
seekFromCurrentPosition(long pos)
Sets reading pointer several bytes forward.
|
void |
seekFromEnd(long pos)
Seeks given number of bytes from the end of stream.
|
void |
unread()
Resets reading pointer one byte backwards.
|
void |
unread(int count)
Resets reading pointer several bytes backwards.
|
close, closeResource, createStreamFromStream, read, read, reset, skipavailable, mark, markSupported, read, read, skippublic abstract void seek(long offset)
throws IOException
offset - is offset of a byte to go to.IOExceptionpublic abstract long getOffset()
throws IOException
IOExceptionpublic abstract long getStreamLength()
throws IOException
IOExceptionpublic abstract int peek()
throws IOException
IOExceptionpublic abstract ASInputStream getStream(long startOffset, long length) throws IOException
startOffset - is starting offset of substream.length - is length of substream.IOExceptionpublic void incrementResourceUsers()
closeResourceincrementResourceUsers in class ASInputStreampublic void decrementResourceUsers()
ASInputStreamcloseResourcedecrementResourceUsers in class ASInputStreampublic boolean isEOF()
throws IOException
IOExceptionpublic void unread()
throws IOException
IOExceptionpublic void unread(int count)
throws IOException
count - is number of bytes to unread.IOExceptionpublic void seekFromCurrentPosition(long pos)
throws IOException
pos - is amount of bytes to skip.IOExceptionpublic void seekFromEnd(long pos)
throws IOException
pos - is a number of bytes to seek from the end of stream.IOExceptionpublic byte readByte()
throws IOException
IOExceptionpublic static SeekableInputStream getSeekableStream(InputStream stream) throws IOException
stream - is stream to turn into seekable stream.IOExceptionCopyright © 2015–2019 The veraPDF Consortium. All rights reserved.