Package com.tangosol.io.nio
Class ByteBufferWriteBuffer.ByteBufferOutput
java.lang.Object
java.io.OutputStream
com.tangosol.io.AbstractWriteBuffer.AbstractBufferOutput
com.tangosol.io.nio.ByteBufferWriteBuffer.ByteBufferOutput
- All Implemented Interfaces:
- com.oracle.coherence.common.io.OutputStreaming,- OutputStreaming,- WriteBuffer.BufferOutput,- Closeable,- DataOutput,- Flushable,- AutoCloseable
- Enclosing class:
- ByteBufferWriteBuffer
public final class ByteBufferWriteBuffer.ByteBufferOutput
extends AbstractWriteBuffer.AbstractBufferOutput
This is a simple implementation of the BufferOutput interface on top of
 a ByteBuffer.
- Author:
- cp 2006.04.07
- 
Field SummaryFields inherited from class com.tangosol.io.AbstractWriteBuffer.AbstractBufferOutputm_ofWriteFields inherited from interface com.tangosol.io.WriteBuffer.BufferOutputMAX_PACKED_INT_SIZE, MAX_PACKED_LONG_SIZE
- 
Constructor SummaryConstructorsConstructorDescriptionByteBufferOutput(int of) Construct a ByteBufferOutput on top of an NIO ByteBuffer.
- 
Method SummaryModifier and TypeMethodDescriptiongetByteBuffer(int cb) Ensure that there are at leastcbbytes of capacity left in thisWriteBuffer.BufferOutput, and return a mutableByteBufferofcbbytes, starting at the current offset.voidwriteChar(int ch) Writes a char value, comprised of the 16 low-order bits of the argument ch; the 16 high-order bits of ch are ignored.voidwriteDouble(double dfl) Writes a double value.voidwriteFloat(float fl) Writes a float value.voidwriteInt(int n) Writes an int value.voidwriteLong(long l) Writes a long value.voidwriteShort(int n) Writes a short value, comprised of the 16 low-order bits of the argument n; the 16 high-order bits of n are ignored.Methods inherited from class com.tangosol.io.AbstractWriteBuffer.AbstractBufferOutputcalcUTF, close, countNegatives, flush, formatModifiedUTF, formatModifiedUTF, formatModifiedUTF, formatUTF, formatUTF, getBuffer, getCharBuf, getOffset, setOffset, write, write, write, writeBoolean, writeBuffer, writeBuffer, writeByte, writeBytes, writeChars, writePackedInt, writePackedLong, writeSafeUTF, writeStream, writeStream, writeUTF, writeUTFMethods inherited from class java.io.OutputStreamnullOutputStream
- 
Constructor Details- 
ByteBufferOutputpublic ByteBufferOutput(int of) Construct a ByteBufferOutput on top of an NIO ByteBuffer.- Parameters:
- of- the offset at which to begin writing
 
 
- 
- 
Method Details- 
getByteBufferEnsure that there are at leastcbbytes of capacity left in thisWriteBuffer.BufferOutput, and return a mutableByteBufferofcbbytes, starting at the current offset.- Parameters:
- cb- the size of the- ByteBufferto return
- Returns:
- a mutable ByteBufferofcbbytes, starting at the current offset
 
- 
writeShortWrites a short value, comprised of the 16 low-order bits of the argument n; the 16 high-order bits of n are ignored.- Specified by:
- writeShortin interface- DataOutput
- Specified by:
- writeShortin interface- WriteBuffer.BufferOutput
- Overrides:
- writeShortin class- AbstractWriteBuffer.AbstractBufferOutput
- Parameters:
- n- the short to write (passed as an integer)
- Throws:
- IOException- if an I/O error occurs
 
- 
writeCharWrites a char value, comprised of the 16 low-order bits of the argument ch; the 16 high-order bits of ch are ignored.- Specified by:
- writeCharin interface- DataOutput
- Specified by:
- writeCharin interface- WriteBuffer.BufferOutput
- Overrides:
- writeCharin class- AbstractWriteBuffer.AbstractBufferOutput
- Parameters:
- ch- the char to write (passed as an integer)
- Throws:
- IOException- if an I/O error occurs
 
- 
writeIntWrites an int value.- Specified by:
- writeIntin interface- DataOutput
- Specified by:
- writeIntin interface- WriteBuffer.BufferOutput
- Overrides:
- writeIntin class- AbstractWriteBuffer.AbstractBufferOutput
- Parameters:
- n- the int to write
- Throws:
- IOException- if an I/O error occurs
 
- 
writeLongWrites a long value.- Specified by:
- writeLongin interface- DataOutput
- Specified by:
- writeLongin interface- WriteBuffer.BufferOutput
- Overrides:
- writeLongin class- AbstractWriteBuffer.AbstractBufferOutput
- Parameters:
- l- the long to write
- Throws:
- IOException- if an I/O error occurs
 
- 
writeFloatWrites a float value.- Specified by:
- writeFloatin interface- DataOutput
- Specified by:
- writeFloatin interface- WriteBuffer.BufferOutput
- Overrides:
- writeFloatin class- AbstractWriteBuffer.AbstractBufferOutput
- Parameters:
- fl- the float to write
- Throws:
- IOException- if an I/O error occurs
 
- 
writeDoubleWrites a double value.- Specified by:
- writeDoublein interface- DataOutput
- Specified by:
- writeDoublein interface- WriteBuffer.BufferOutput
- Overrides:
- writeDoublein class- AbstractWriteBuffer.AbstractBufferOutput
- Parameters:
- dfl- the double to write
- Throws:
- IOException- if an I/O error occurs
 
 
-