Package loci.common

Class 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:
  • Constructor Details

    • 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 Details

    • 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 class StreamHandle
      Throws:
      IOException - if the stream cannot be reset