public final class DataOutputBuffer extends DataOutputStreamPlus
out| Constructor and Description |
|---|
DataOutputBuffer() |
DataOutputBuffer(int size) |
| Modifier and Type | Method and Description |
|---|---|
java.nio.ByteBuffer |
asByteBuffer() |
byte[] |
getData()
Returns the current contents of the buffer.
|
int |
getLength()
Returns the length of the valid data currently in the buffer.
|
byte[] |
toByteArray() |
void |
write(byte[] b,
int off,
int len)
Writes
count bytes from the byte array buffer
starting at offset to this RandomAccessFile starting at
the current file pointer.. |
void |
write(java.nio.ByteBuffer buffer) |
void |
write(int b)
Writes the specified byte
oneByte to this RandomAccessFile
starting at the current file pointer. |
close, flushwrite, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTFclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwritepublic DataOutputBuffer()
public DataOutputBuffer(int size)
public void write(int b)
AbstractDataOutputoneByte to this RandomAccessFile
starting at the current file pointer. Only the low order byte of
oneByte is written.write in interface java.io.DataOutputwrite in class DataOutputStreamPlusb - the byte to be writtenpublic void write(byte[] b,
int off,
int len)
AbstractDataOutputcount bytes from the byte array buffer
starting at offset to this RandomAccessFile starting at
the current file pointer..write in interface java.io.DataOutputwrite in class DataOutputStreamPlusb - the bytes to be writtenoff - offset in buffer to get byteslen - number of bytes in buffer to writepublic void write(java.nio.ByteBuffer buffer)
throws java.io.IOException
write in interface DataOutputPluswrite in class AbstractDataOutputjava.io.IOExceptionpublic byte[] getData()
getLength().public byte[] toByteArray()
public java.nio.ByteBuffer asByteBuffer()
public int getLength()
Copyright © 2015 The Apache Software Foundation