Package loci.common
Class URLHandle
java.lang.Object
loci.common.StreamHandle
loci.common.URLHandle
- All Implemented Interfaces:
DataInput,DataOutput,IRandomAccess
Provides random access to URLs using the IRandomAccess interface.
Instances of URLHandle are read-only.
- Author:
- Melissa Linkert melissa at glencoesoftware.com
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class loci.common.StreamHandle
StreamHandle.Settings -
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidClose and reopen the stream; the stream pointer and mark should be reset to 0.voidseek(long pos) Sets the stream pointer offset, measured from the beginning of this stream, at which the next read or write occurs.Methods inherited from class loci.common.StreamHandle
close, exists, getFilePointer, getOrder, length, read, read, read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, setOrder, skipBytes, skipBytes, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Constructor Details
-
URLHandle
Constructs a new URLHandle using the given URL.- Parameters:
url- the fully qualified URL path- Throws:
IOException- if the URL is invalid or unreadable
-
-
Method Details
-
seek
Description copied from interface:IRandomAccessSets the stream pointer offset, measured from the beginning of this stream, at which the next read or write occurs.- Specified by:
seekin interfaceIRandomAccess- Overrides:
seekin classStreamHandle- Parameters:
pos- new byte offset (pointer) in the current stream. Unless otherwise noted, may be larger or smaller than the current pointer, but must be non-negative and less than the value of #length()- Throws:
IOException- ifposis invalid or the seek fails- See Also:
-
resetStream
Description copied from class:StreamHandleClose and reopen the stream; the stream pointer and mark should be reset to 0. This method is called if we need to seek backwards within the stream.- Specified by:
resetStreamin classStreamHandle- Throws:
IOException- if the stream cannot be reset
-