Class BufferedFileOutput
- java.lang.Object
-
- org.apache.hugegraph.computer.core.io.UnsafeBytesOutput
-
- org.apache.hugegraph.computer.core.io.AbstractBufferedFileOutput
-
- org.apache.hugegraph.computer.core.io.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.
-
-
Field Summary
-
Fields inherited from class org.apache.hugegraph.computer.core.io.AbstractBufferedFileOutput
fileOffset
-
-
Constructor Summary
Constructors Constructor Description BufferedFileOutput(java.io.File file)BufferedFileOutput(java.io.RandomAccessFile file, int bufferCapacity)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected voidflushBuffer()voidseek(long position)voidwrite(byte[] b)voidwrite(byte[] b, int off, int len)-
Methods inherited from class org.apache.hugegraph.computer.core.io.AbstractBufferedFileOutput
bufferAvailable, bufferCapacity, bufferSize, position, require, skip, writeFixedInt
-
Methods inherited from class org.apache.hugegraph.computer.core.io.UnsafeBytesOutput
buffer, require, toByteArray, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFixedInt, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
-
-
-
Method Detail
-
write
public void write(byte[] b) throws java.io.IOException- Specified by:
writein interfacejava.io.DataOutput- Overrides:
writein classUnsafeBytesOutput- Throws:
java.io.IOException
-
write
public void write(byte[] b, int off, int len) throws java.io.IOException- Specified by:
writein interfacejava.io.DataOutput- Overrides:
writein classUnsafeBytesOutput- Throws:
java.io.IOException
-
seek
public void seek(long position) throws java.io.IOException- Specified by:
seekin interfaceorg.apache.hugegraph.computer.core.io.RandomAccessOutput- Overrides:
seekin classUnsafeBytesOutput- Throws:
java.io.IOException
-
flushBuffer
protected void flushBuffer() throws java.io.IOException- Specified by:
flushBufferin classAbstractBufferedFileOutput- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classUnsafeBytesOutput- Throws:
java.io.IOException
-
-