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, flush
write, write, writeBoolean, writeByte, writeBytes, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeShort, writeUTF
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
write
public DataOutputBuffer()
public DataOutputBuffer(int size)
public void write(int b)
AbstractDataOutput
oneByte
to this RandomAccessFile
starting at the current file pointer. Only the low order byte of
oneByte
is written.write
in interface java.io.DataOutput
write
in class DataOutputStreamPlus
b
- the byte to be writtenpublic void write(byte[] b, int off, int len)
AbstractDataOutput
count
bytes from the byte array buffer
starting at offset
to this RandomAccessFile starting at
the current file pointer..write
in interface java.io.DataOutput
write
in class DataOutputStreamPlus
b
- 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 DataOutputPlus
write
in class AbstractDataOutput
java.io.IOException
public byte[] getData()
getLength()
.public byte[] toByteArray()
public java.nio.ByteBuffer asByteBuffer()
public int getLength()
Copyright © 2014 The Apache Software Foundation