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
Constructors Constructor Description ByteBufferOutput(int of)Construct a ByteBufferOutput on top of an NIO ByteBuffer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.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
-
-
-
-
Method Detail
-
writeShort
public void writeShort(int n) throws IOExceptionWrites 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 interfaceDataOutput- Specified by:
writeShortin interfaceWriteBuffer.BufferOutput- Overrides:
writeShortin classAbstractWriteBuffer.AbstractBufferOutput- Parameters:
n- the short to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
writeChar
public void writeChar(int ch) throws IOExceptionWrites 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 interfaceDataOutput- Specified by:
writeCharin interfaceWriteBuffer.BufferOutput- Overrides:
writeCharin classAbstractWriteBuffer.AbstractBufferOutput- Parameters:
ch- the char to write (passed as an integer)- Throws:
IOException- if an I/O error occurs
-
writeInt
public void writeInt(int n) throws IOExceptionWrites an int value.- Specified by:
writeIntin interfaceDataOutput- Specified by:
writeIntin interfaceWriteBuffer.BufferOutput- Overrides:
writeIntin classAbstractWriteBuffer.AbstractBufferOutput- Parameters:
n- the int to write- Throws:
IOException- if an I/O error occurs
-
writeLong
public void writeLong(long l) throws IOExceptionWrites a long value.- Specified by:
writeLongin interfaceDataOutput- Specified by:
writeLongin interfaceWriteBuffer.BufferOutput- Overrides:
writeLongin classAbstractWriteBuffer.AbstractBufferOutput- Parameters:
l- the long to write- Throws:
IOException- if an I/O error occurs
-
writeFloat
public void writeFloat(float fl) throws IOExceptionWrites a float value.- Specified by:
writeFloatin interfaceDataOutput- Specified by:
writeFloatin interfaceWriteBuffer.BufferOutput- Overrides:
writeFloatin classAbstractWriteBuffer.AbstractBufferOutput- Parameters:
fl- the float to write- Throws:
IOException- if an I/O error occurs
-
writeDouble
public void writeDouble(double dfl) throws IOExceptionWrites a double value.- Specified by:
writeDoublein interfaceDataOutput- Specified by:
writeDoublein interfaceWriteBuffer.BufferOutput- Overrides:
writeDoublein classAbstractWriteBuffer.AbstractBufferOutput- Parameters:
dfl- the double to write- Throws:
IOException- if an I/O error occurs
-
-