Package org.datavec.api.io
Class DataOutputBuffer
- java.lang.Object
-
- java.io.OutputStream
-
- java.io.FilterOutputStream
-
- java.io.DataOutputStream
-
- org.datavec.api.io.DataOutputBuffer
-
- All Implemented Interfaces:
Closeable
,DataOutput
,Flushable
,AutoCloseable
public class DataOutputBuffer extends DataOutputStream
-
-
Field Summary
-
Fields inherited from class java.io.DataOutputStream
written
-
Fields inherited from class java.io.FilterOutputStream
out
-
-
Constructor Summary
Constructors Constructor Description DataOutputBuffer()
Constructs a new empty buffer.DataOutputBuffer(int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
getData()
Returns the current contents of the buffer.int
getLength()
Returns the length of the valid data currently in the buffer.DataOutputBuffer
reset()
Resets the buffer to empty.void
write(DataInput in, int length)
Writes bytes from a DataInput directly into the buffer.void
writeTo(OutputStream out)
Write to a file stream-
Methods inherited from class java.io.DataOutputStream
flush, size, write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
-
Methods inherited from class java.io.FilterOutputStream
close, write
-
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.io.DataOutput
write
-
-
-
-
Method Detail
-
getData
public byte[] getData()
Returns the current contents of the buffer. Data is only valid togetLength()
.
-
getLength
public int getLength()
Returns the length of the valid data currently in the buffer.
-
reset
public DataOutputBuffer reset()
Resets the buffer to empty.
-
write
public void write(DataInput in, int length) throws IOException
Writes bytes from a DataInput directly into the buffer.- Throws:
IOException
-
writeTo
public void writeTo(OutputStream out) throws IOException
Write to a file stream- Throws:
IOException
-
-