Class SimpleGzReader

java.lang.Object
com.compomics.util.io.flat.readers.SimpleGzReader
All Implemented Interfaces:
SimpleFileReader, AutoCloseable

public class SimpleGzReader
extends Object
implements SimpleFileReader
Simple wrapper for a gz file reader.
Author:
Marc Vaudel
  • Constructor Details

    • SimpleGzReader

      public SimpleGzReader​(File file)
      Constructor.
      Parameters:
      file - the file to read
  • Method Details

    • readLine

      public String readLine()
      Description copied from interface: SimpleFileReader
      Reads a line of the file.
      Specified by:
      readLine in interface SimpleFileReader
      Returns:
      a line of the file
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface SimpleFileReader
    • getReader

      public Reader getReader()
      Description copied from interface: SimpleFileReader
      Returns the underlying reader.
      Specified by:
      getReader in interface SimpleFileReader
      Returns:
      The underlying reader.
    • getProgressInPercent

      public double getProgressInPercent()
      Description copied from interface: SimpleFileReader
      Returns the progress reading the file in percent.
      Specified by:
      getProgressInPercent in interface SimpleFileReader
      Returns:
      The progress reading the file in percent.
    • read

      public int read​(char[] buffer)
      Description copied from interface: SimpleFileReader
      Reads characters into an array.
      Specified by:
      read in interface SimpleFileReader
      Parameters:
      buffer - The destination buffer.
      Returns:
      The number of characters read, -1 if the end of the stream has been reached.
    • read

      public int read​(char[] buffer, int offset, int length)
      Description copied from interface: SimpleFileReader
      Reads characters into an array.
      Specified by:
      read in interface SimpleFileReader
      Parameters:
      buffer - The destination buffer.
      offset - The offset at which to start storing characters
      length - The maximum number of characters to read
      Returns:
      The number of characters read, -1 if the end of the stream has been reached.