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 Summary
Fields inherited from class com.tangosol.io.AbstractWriteBuffer.AbstractBufferOutput
m_ofWrite
Fields inherited from interface com.tangosol.io.WriteBuffer.BufferOutput
MAX_PACKED_INT_SIZE, MAX_PACKED_LONG_SIZE
-
Constructor Summary
ConstructorDescriptionByteBufferOutput
(int of) Construct a ByteBufferOutput on top of an NIO ByteBuffer. -
Method Summary
Modifier and TypeMethodDescriptionvoid
writeChar
(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.void
writeDouble
(double dfl) Writes a double value.void
writeFloat
(float fl) Writes a float value.void
writeInt
(int n) Writes an int value.void
writeLong
(long l) Writes a long value.void
writeShort
(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.AbstractBufferOutput
calcUTF, close, flush, formatUTF, formatUTF, getBuffer, getCharBuf, getOffset, setOffset, write, write, write, writeBoolean, writeBuffer, writeBuffer, writeByte, writeBytes, writeChars, writePackedInt, writePackedLong, writeSafeUTF, writeStream, writeStream, writeUTF, writeUTF
Methods inherited from class java.io.OutputStream
nullOutputStream
-
Constructor Details
-
ByteBufferOutput
public ByteBufferOutput(int of) Construct a ByteBufferOutput on top of an NIO ByteBuffer.- Parameters:
of
- the offset at which to begin writing
-
-
Method Details
-
writeShort
Writes 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:
writeShort
in interfaceDataOutput
- Specified by:
writeShort
in interfaceWriteBuffer.BufferOutput
- Overrides:
writeShort
in classAbstractWriteBuffer.AbstractBufferOutput
- Parameters:
n
- the short to write (passed as an integer)- Throws:
IOException
- if an I/O error occurs
-
writeChar
Writes 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:
writeChar
in interfaceDataOutput
- Specified by:
writeChar
in interfaceWriteBuffer.BufferOutput
- Overrides:
writeChar
in classAbstractWriteBuffer.AbstractBufferOutput
- Parameters:
ch
- the char to write (passed as an integer)- Throws:
IOException
- if an I/O error occurs
-
writeInt
Writes an int value.- Specified by:
writeInt
in interfaceDataOutput
- Specified by:
writeInt
in interfaceWriteBuffer.BufferOutput
- Overrides:
writeInt
in classAbstractWriteBuffer.AbstractBufferOutput
- Parameters:
n
- the int to write- Throws:
IOException
- if an I/O error occurs
-
writeLong
Writes a long value.- Specified by:
writeLong
in interfaceDataOutput
- Specified by:
writeLong
in interfaceWriteBuffer.BufferOutput
- Overrides:
writeLong
in classAbstractWriteBuffer.AbstractBufferOutput
- Parameters:
l
- the long to write- Throws:
IOException
- if an I/O error occurs
-
writeFloat
Writes a float value.- Specified by:
writeFloat
in interfaceDataOutput
- Specified by:
writeFloat
in interfaceWriteBuffer.BufferOutput
- Overrides:
writeFloat
in classAbstractWriteBuffer.AbstractBufferOutput
- Parameters:
fl
- the float to write- Throws:
IOException
- if an I/O error occurs
-
writeDouble
Writes a double value.- Specified by:
writeDouble
in interfaceDataOutput
- Specified by:
writeDouble
in interfaceWriteBuffer.BufferOutput
- Overrides:
writeDouble
in classAbstractWriteBuffer.AbstractBufferOutput
- Parameters:
dfl
- the double to write- Throws:
IOException
- if an I/O error occurs
-