Class BufferedFileOutput

  • All Implemented Interfaces:
    java.io.Closeable, java.io.DataOutput, java.lang.AutoCloseable, org.apache.hugegraph.computer.core.io.BytesOutput, org.apache.hugegraph.computer.core.io.RandomAccessOutput

    public class BufferedFileOutput
    extends AbstractBufferedFileOutput
    This class acted as new DataOutputStream(new BufferedOutputStream(new File (file))). It has two functions. The first is buffer the content until the buffer is full. The second is unsafe data output. This class is not thread safe.
    • Constructor Detail

      • BufferedFileOutput

        public BufferedFileOutput​(java.io.File file)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • BufferedFileOutput

        public BufferedFileOutput​(java.io.RandomAccessFile file,
                                  int bufferCapacity)
    • Method Detail

      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        Specified by:
        write in interface java.io.DataOutput
        Overrides:
        write in class UnsafeBytesOutput
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
                   throws java.io.IOException
        Specified by:
        write in interface java.io.DataOutput
        Overrides:
        write in class UnsafeBytesOutput
        Throws:
        java.io.IOException
      • seek

        public void seek​(long position)
                  throws java.io.IOException
        Specified by:
        seek in interface org.apache.hugegraph.computer.core.io.RandomAccessOutput
        Overrides:
        seek in class UnsafeBytesOutput
        Throws:
        java.io.IOException
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Overrides:
        close in class UnsafeBytesOutput
        Throws:
        java.io.IOException