public class ChannelBufferUnsafeDataOutputStream extends ChannelBufferUnsafeOutputStream implements DataOutput
UnsafeHolder.getDirectByteBufferAddressMethod() to be non-null before
trying to use this class.
The implementation is not thread-safe by design. This particular class can be used as an efficient, buffered DataOutput implementation for file channels, socket channels and other similar.
addrLimit, addrPosition, baseAddress, buffer, MIN_BUFFER_SIZE, unsafechannel, PARK_NANOS, PARK_NANOS_MAX, parkedThread| Constructor and Description |
|---|
ChannelBufferUnsafeDataOutputStream(WritableByteChannel channel) |
ChannelBufferUnsafeDataOutputStream(WritableByteChannel channel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
protected static long |
putInt(long addrPos,
int v) |
protected static long |
putShort(long addrPos,
int v) |
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) |
allocateBuffer, close, flush, flushBufferBlocking, flushBufferNonBlocking, isOpen, resetBufferPositions, write_, write, write, write, writegetParkedThread, getUnderlyingChannel, writeBuffer, writeBuffered, writeBufferNonBlockingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, writepublic ChannelBufferUnsafeDataOutputStream(WritableByteChannel channel) throws IOException
IOExceptionpublic ChannelBufferUnsafeDataOutputStream(WritableByteChannel channel, int bufferSize) throws IOException
IOExceptionpublic final void writeBoolean(boolean v)
throws IOException
writeBoolean in interface DataOutputIOExceptionpublic final void writeByte(int v)
throws IOException
writeByte 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 final void writeInt(int v)
throws IOException
writeInt in interface DataOutputIOExceptionpublic final void writeLong(long v)
throws IOException
writeLong in interface DataOutputIOExceptionpublic final void writeFloat(float v)
throws IOException
writeFloat in interface DataOutputIOExceptionpublic final void writeDouble(double v)
throws IOException
writeDouble in interface DataOutputIOExceptionpublic final void writeBytes(String s) throws IOException
writeBytes in interface DataOutputIOExceptionpublic final void writeChars(String s) throws IOException
writeChars in interface DataOutputIOExceptionpublic final void writeUTF(String str) throws IOException
writeUTF in interface DataOutputIOExceptionprotected static final long putShort(long addrPos,
int v)
protected static final long putInt(long addrPos,
int v)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.