Class AbstractBufferedFileInput

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataInput, java.lang.AutoCloseable, org.apache.hugegraph.computer.core.io.BytesInput, org.apache.hugegraph.computer.core.io.RandomAccessInput
    Direct Known Subclasses:
    BufferedFileInput, ValueFileInput

    public abstract class AbstractBufferedFileInput
    extends UnsafeBytesInput
    • Field Detail

      • fileOffset

        protected long fileOffset
    • Constructor Detail

      • AbstractBufferedFileInput

        public AbstractBufferedFileInput​(int bufferCapacity,
                                         long fileLength)
    • Method Detail

      • position

        public long position()
        Specified by:
        position in interface org.apache.hugegraph.computer.core.io.RandomAccessInput
        Overrides:
        position in class UnsafeBytesInput
      • readFully

        public void readFully​(byte[] b)
                       throws java.io.IOException
        Specified by:
        readFully in interface java.io.DataInput
        Overrides:
        readFully in class UnsafeBytesInput
        Throws:
        java.io.IOException
      • skip

        public long skip​(long bytesToSkip)
                  throws java.io.IOException
        Specified by:
        skip in interface org.apache.hugegraph.computer.core.io.RandomAccessInput
        Overrides:
        skip in class UnsafeBytesInput
        Throws:
        java.io.IOException
      • require

        protected void require​(int size)
                        throws java.io.IOException
        Overrides:
        require in class UnsafeBytesInput
        Throws:
        java.io.IOException
      • available

        public long available()
                       throws java.io.IOException
        Specified by:
        available in interface org.apache.hugegraph.computer.core.io.RandomAccessInput
        Overrides:
        available in class UnsafeBytesInput
        Throws:
        java.io.IOException
      • shiftAndFillBuffer

        protected void shiftAndFillBuffer()
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • fillBuffer

        protected abstract void fillBuffer()
                                    throws java.io.IOException
        Throws:
        java.io.IOException
      • compare

        public int compare​(long offset,
                           long length,
                           org.apache.hugegraph.computer.core.io.RandomAccessInput other,
                           long otherOffset,
                           long otherLength)
                    throws java.io.IOException
        Specified by:
        compare in interface org.apache.hugegraph.computer.core.io.RandomAccessInput
        Overrides:
        compare in class UnsafeBytesInput
        Throws:
        java.io.IOException
      • bufferCapacity

        protected int bufferCapacity()
      • fileLength

        protected long fileLength()