public interface SeekableSource extends ReadableByteChannel
| Modifier and Type | Method and Description |
|---|---|
default InputStream |
asInputStream()
Creates an
InputStream from this SeekableSource. |
default SeekableSource |
back()
Skips backward moving back the source position of one byte
|
default SeekableSource |
back(long offset)
Skips backward the given number of bytes moving back the source position
|
default SeekableSource |
forward(long offset)
Skips the given number of bytes moving forward the source position
|
String |
id() |
default int |
peek()
Reads the next byte and sets the position back by one.
|
default int |
peekBack()
Reads the previous byte and sets the position back where it was.
|
long |
position() |
SeekableSource |
position(long position)
Sets the source position.
|
int |
read()
Reads a byte of data from this source.
|
long |
size() |
SeekableSource |
view(long startingPosition,
long length) |
readString id()
long position()
throws IOException
IOExceptionSeekableSource position(long position) throws IOException
position - a non-negative long for the new positionIOExceptionlong size()
int read() throws IOException
0x00-0xff ).-1 if there is no more data.IOExceptionSeekableSource view(long startingPosition, long length) throws IOException
startingPosition - length - SeekableSource. Reading from the view doesn't affect the SeekableSource position. Closing the
SeekableSource makes all the views unreadable but closing the view has no effect on the SeekableSource. A view may or may not work on a thread bound
copy of the SeekableSource so as a general rule it should not be created and handed to other threads..IOException - if something goes wrong while creating the viewdefault SeekableSource back(long offset) throws IOException
offset - the number of bytes to skip back.IOExceptiondefault SeekableSource back() throws IOException
IOExceptionback(long)default SeekableSource forward(long offset) throws IOException
offset - the number of bytes to skip .IOExceptiondefault int peek()
throws IOException
-1 if there is no more data.IOExceptionread()default int peekBack()
throws IOException
-1 if we are at the beginning of the source.IOExceptionread()default InputStream asInputStream()
InputStream from this SeekableSource.SeekableSourceCopyright © 2018 sejda. All rights reserved.