Package loci.common
Class GZipHandle
- java.lang.Object
-
- loci.common.StreamHandle
-
- loci.common.GZipHandle
-
- All Implemented Interfaces:
DataInput
,DataOutput
,IRandomAccess
public class GZipHandle extends StreamHandle
StreamHandle implementation for reading from gzip-compressed files or byte arrays. Instances of GZipHandle are read-only.- Author:
- Melissa Linkert melissa at glencoesoftware.com
- See Also:
StreamHandle
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class loci.common.StreamHandle
StreamHandle.Settings
-
-
Constructor Summary
Constructors Constructor Description GZipHandle(String file)
Construct a new GZipHandle for the given file.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static boolean
isGZipFile(String file)
protected void
resetStream()
Close 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 Detail
-
GZipHandle
public GZipHandle(String file) throws IOException
Construct a new GZipHandle for the given file.- Parameters:
file
- the path to the GZip file- Throws:
HandleException
- if the given file name is not a GZip file.IOException
-
-
Method Detail
-
isGZipFile
public static boolean isGZipFile(String file) throws IOException
- Parameters:
file
- the path to the GZip file- Returns:
- true if the given filename is a gzip file
- Throws:
IOException
- if the file cannot be read
-
resetStream
protected void resetStream() throws IOException
Description copied from class:StreamHandle
Close 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:
resetStream
in classStreamHandle
- Throws:
IOException
- if the stream cannot be reset
-
-