Package loci.common
Class BZip2Handle
java.lang.Object
loci.common.StreamHandle
loci.common.BZip2Handle
- All Implemented Interfaces:
DataInput,DataOutput,IRandomAccess
StreamHandle implementation for reading from BZip2-compressed files
or byte arrays. Instances of BZip2Handle 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
ConstructorsConstructorDescriptionBZip2Handle(String file) Construct a new BZip2Handle corresponding to the given file. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisBZip2File(String file) Returns true if the given filename is a BZip2 file.protected voidClose and reopen the stream; the stream pointer and mark should be reset to 0.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, seek, setOrder, skipBytes, skipBytes, write, write, write, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Constructor Details
-
BZip2Handle
Construct a new BZip2Handle corresponding to the given file.- Parameters:
file- the path to a file on disk- Throws:
HandleException- if the given file is not a BZip2 file.IOException
-
-
Method Details
-
isBZip2File
Returns true if the given filename is a BZip2 file.- Parameters:
file- the path to a file on disk- Returns:
- true if file's extension is .bz2 and the first 2 bytes are the BZip2 magic marker
- Throws:
IOException- if the file is not readable
-
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
-