Class FileIO.ReadableFile

  • Enclosing class:
    FileIO

    public static final class FileIO.ReadableFile
    extends java.lang.Object
    A utility class for accessing a potentially compressed file.
    • Method Detail

      • getCompression

        public Compression getCompression()
        Returns the method with which this file will be decompressed in open().
      • open

        public java.nio.channels.ReadableByteChannel open()
                                                   throws java.io.IOException
        Returns a ReadableByteChannel reading the data from this file, potentially decompressing it using getCompression().
        Throws:
        java.io.IOException
      • openSeekable

        public java.nio.channels.SeekableByteChannel openSeekable()
                                                           throws java.io.IOException
        Returns a SeekableByteChannel equivalent to open(), but fails if this file is not seekable.
        Throws:
        java.io.IOException
      • readFullyAsBytes

        public byte[] readFullyAsBytes()
                                throws java.io.IOException
        Returns the full contents of the file as bytes.
        Throws:
        java.io.IOException
      • readFullyAsUTF8String

        public java.lang.String readFullyAsUTF8String()
                                               throws java.io.IOException
        Returns the full contents of the file as a String decoded as UTF-8.
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object