public abstract class AbstractSeekableStreamHandle<L extends Location> extends AbstractStreamHandle<L> implements SeekableStreamHandle<L>
DataHandle.ByteOrder
DEFAULT_BLOCK_SIZE, MAX_SEARCH_SIZE
Constructor and Description |
---|
AbstractSeekableStreamHandle() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
recreatePossible()
In some implementations of this class, the ability to recreate the stream
depends on external factors (e.g.
|
protected abstract void |
recreateStreamFromPos(long pos)
Recreates the internal input stream available through
StreamHandle.in() , so
that it starts from the specified position. |
void |
seek(long pos)
Sets the stream offset, measured from the beginning of the stream, at which
the next read or write occurs.
|
protected void |
setJumpCutoff(long jumpCutoff)
Sets the maximum of bytes which are read from the stream when seeking
forward.
|
offset, setOffset
conversionBuffer, getEncoding, getOrder, setEncoding, setOrder
get, set
supports
getInfo, getPriority, setInfo, setPriority, toString
context, getContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
resetStream
advance, close, ensureReadable, ensureWritable, in, jump, out, read, read, readByte, setOffset, write, write, writeByte
available, checksum, conversionBuffer, exists, findString, findString, findString, findString, getEncoding, getOrder, isBigEndian, isLittleEndian, isReadable, isWritable, lastModified, length, offset, read, readBoolean, readChar, readCString, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readString, readString, readUnsignedByte, readUnsignedShort, readUTF, setEncoding, setLength, setLittleEndian, setOrder, skip, skipBytes, write, writeBoolean, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLine, writeLong, writeShort, writeUTF
get, set
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
public void seek(long pos) throws IOException
DataHandle
seek
in interface DataHandle<L extends Location>
seek
in interface ResettableStreamHandle<L extends Location>
seek
in interface SeekableStreamHandle<L extends Location>
seek
in interface StreamHandle<L extends Location>
IOException
protected abstract void recreateStreamFromPos(long pos) throws IOException
StreamHandle.in()
, so
that it starts from the specified position.pos
- IOException
protected abstract boolean recreatePossible() throws IOException
IOException
protected void setJumpCutoff(long jumpCutoff)
recreateStreamFromPos(long)
.Copyright © 2015–2022 SciJava. All rights reserved.