Package org.scijava.io.handle
Class AbstractSeekableStreamHandle<L extends Location>
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.plugin.AbstractTypedPlugin<D>
-
- org.scijava.plugin.AbstractWrapperPlugin<L>
-
- org.scijava.io.handle.AbstractDataHandle<L>
-
- org.scijava.io.handle.AbstractStreamHandle<L>
-
- org.scijava.io.handle.AbstractSeekableStreamHandle<L>
-
- All Implemented Interfaces:
Closeable,DataInput,DataOutput,AutoCloseable,Comparable<Prioritized>,Contextual,Identifiable,DataHandle<L>,ResettableStreamHandle<L>,SeekableStreamHandle<L>,StreamHandle<L>,Locatable,Logged,HasPluginInfo,RichPlugin,SciJavaPlugin,TypedPlugin<L>,WrapperPlugin<L>,Prioritized,Typed<L>,Versioned
public abstract class AbstractSeekableStreamHandle<L extends Location> extends AbstractStreamHandle<L> implements SeekableStreamHandle<L>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.scijava.io.handle.DataHandle
DataHandle.ByteOrder
-
-
Field Summary
-
Fields inherited from interface org.scijava.io.handle.DataHandle
DEFAULT_BLOCK_SIZE, MAX_SEARCH_SIZE
-
-
Constructor Summary
Constructors Constructor Description AbstractSeekableStreamHandle()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract booleanrecreatePossible()In some implementations of this class, the ability to recreate the stream depends on external factors (e.g. server support).protected abstract voidrecreateStreamFromPos(long pos)Recreates the internal input stream available throughStreamHandle.in(), so that it starts from the specified position.voidseek(long pos)Sets the stream offset, measured from the beginning of the stream, at which the next read or write occurs.protected voidsetJumpCutoff(long jumpCutoff)Sets the maximum of bytes which are read from the stream when seeking forward.-
Methods inherited from class org.scijava.io.handle.AbstractStreamHandle
offset, setOffset
-
Methods inherited from class org.scijava.io.handle.AbstractDataHandle
conversionBuffer, getEncoding, getOrder, setEncoding, setOrder
-
Methods inherited from class org.scijava.plugin.AbstractWrapperPlugin
get, set
-
Methods inherited from class org.scijava.plugin.AbstractTypedPlugin
supports
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority, toString
-
Methods inherited from class org.scijava.AbstractContextual
context, getContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.io.handle.DataHandle
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
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.io.handle.ResettableStreamHandle
resetStream
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.io.handle.StreamHandle
advance, close, ensureReadable, ensureWritable, in, jump, out, read, read, readByte, setOffset, write, write, writeByte
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
Methods inherited from interface org.scijava.plugin.WrapperPlugin
get, set
-
-
-
-
Method Detail
-
seek
public void seek(long pos) throws IOExceptionDescription copied from interface:DataHandleSets the stream offset, measured from the beginning of the stream, at which the next read or write occurs.- Specified by:
seekin interfaceDataHandle<L extends Location>- Specified by:
seekin interfaceResettableStreamHandle<L extends Location>- Specified by:
seekin interfaceSeekableStreamHandle<L extends Location>- Specified by:
seekin interfaceStreamHandle<L extends Location>- Throws:
IOException
-
recreateStreamFromPos
protected abstract void recreateStreamFromPos(long pos) throws IOExceptionRecreates the internal input stream available throughStreamHandle.in(), so that it starts from the specified position.- Parameters:
pos-- Throws:
IOException
-
recreatePossible
protected abstract boolean recreatePossible() throws IOExceptionIn some implementations of this class, the ability to recreate the stream depends on external factors (e.g. server support). This influences a- Returns:
- if recreate is actually possible.
- Throws:
IOException
-
setJumpCutoff
protected void setJumpCutoff(long jumpCutoff)
Sets the maximum of bytes which are read from the stream when seeking forward. Any larger number will result in a call torecreateStreamFromPos(long).
-
-