public class DataOutputBuffer extends ByteArrayBuffer implements DataOutput
DataOutput API.
Note: The base classes provide all of the same functionality without
declaring IOException as a thrown exception.
DEFAULT_INITIAL_CAPACITY| Constructor and Description |
|---|
DataOutputBuffer()
Uses the default for
ByteArrayBuffer.ByteArrayBuffer(). |
DataOutputBuffer(InputStream in)
Reads the entire input stream into the buffer.
|
DataOutputBuffer(int initialCapacity) |
DataOutputBuffer(int len,
byte[] buf) |
DataOutputBuffer(ObjectInput in)
Reads the entire input stream into the buffer.
|
| Modifier and Type | Method and Description |
|---|---|
DataOutputBuffer |
reset()
Conforms the return type to an instance of this class.
|
void |
write(DataInput in,
int len)
Read len bytes into the buffer.
|
void |
writeBoolean(boolean v) |
void |
writeByte(int v) |
void |
writeBytes(String s) |
void |
writeChar(int v) |
void |
writeChars(String s) |
void |
writeDouble(double v) |
void |
writeFloat(float v) |
void |
writeInt(int v) |
void |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(String str) |
void |
writeUTF2(String str)
Version of
writeUTF(String) which wraps the IOException. |
advancePosAndLimit, append, append, append, array, asByteBuffer, assertNonNegative, capacity, clear, copy, copyAll, copyRest, ensureCapacity, ensureFree, ensureFree, extend, flip, get, get, getBit, getByte, getByte, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getLong, getLong, getOutputBitStream, getShort, getShort, len, limit, mark, off, packLong, packShort, pos, pos, position, position, put, put, put, put, putByte, putByte, putDouble, putDouble, putFloat, putFloat, putInt, putInt, putLong, putLong, putShort, putShort, remaining, rewind, setBit, skip, slice, toByteArray, trim, write, write, writeclose, flushclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, writepublic DataOutputBuffer()
ByteArrayBuffer.ByteArrayBuffer().public DataOutputBuffer(int initialCapacity)
initialCapacity - The initial capacity of the internal byte[].public DataOutputBuffer(int len,
byte[] buf)
len - The #of bytes of data already in the provided buffer.buf - The buffer, with len pre-existing bytes of valid data.
The buffer reference is used directly rather than making a
copy of the data.public DataOutputBuffer(InputStream in) throws IOException
ByteArrayBuffer.buf from position 0 (inclusive) through position
ByteArrayBuffer.pos (exclusive).IOExceptionpublic DataOutputBuffer(ObjectInput in) throws IOException
ByteArrayBuffer.buf from position 0 (inclusive) through position
ByteArrayBuffer.pos (exclusive).IOExceptionpublic DataOutputBuffer reset()
reset in interface IManagedByteArrayreset in class ByteArrayBufferpublic final void write(DataInput in, int len) throws IOException
in - The input source.len - The #of bytes to read.EOFException - if the EOF is reached before len bytes have been read.IOException - if an I/O error occurs.public final void writeBoolean(boolean v)
throws IOException
writeBoolean in interface DataOutputIOExceptionpublic final void writeByte(int v)
throws IOException
writeByte in interface DataOutputIOExceptionpublic final void writeDouble(double v)
throws IOException
writeDouble in interface DataOutputIOExceptionpublic final void writeFloat(float v)
throws IOException
writeFloat in interface DataOutputIOExceptionpublic final void writeInt(int v)
throws IOException
writeInt in interface DataOutputIOExceptionpublic final void writeLong(long v)
throws IOException
writeLong in interface DataOutputIOExceptionpublic final void writeShort(int v)
throws IOException
writeShort in interface DataOutputIOExceptionpublic final void writeChar(int v)
throws IOException
writeChar in interface DataOutputIOExceptionpublic void writeBytes(String s) throws IOException
writeBytes in interface DataOutputIOExceptionpublic void writeChars(String s) throws IOException
writeChars in interface DataOutputIOExceptionpublic void writeUTF(String str) throws IOException
writeUTF in interface DataOutputIOExceptionpublic void writeUTF2(String str)
writeUTF(String) which wraps the IOException.str - The string.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.