public class ChannelBufferUnsafeDataOutputStream extends ChannelBufferUnsafeOutputStream implements DataOutput
UnsafeHolder.hasUnsafe() 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_SIZEbytesWritten, channel, PARK_NANOS_MAX, parkedThread| Constructor and Description |
|---|
ChannelBufferUnsafeDataOutputStream(WritableByteChannel channel) |
ChannelBufferUnsafeDataOutputStream(WritableByteChannel channel,
int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
protected static long |
putLong(long addrPos,
long v)
Write a long in big-endian format on given off-heap address.
|
protected static long |
putShort(long addrPos,
int v)
Write a short in big-endian format on given off-heap address.
|
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 |
writeLong(long v) |
void |
writeShort(int v) |
void |
writeUTF(String str) |
static long |
writeUTFSegmentNoOverflow(String str,
int offset,
int length,
int utfLen,
Object target,
long addrPos) |
allocateBuffer, close, closeChannel, flush, flushBufferBlocking, getInternalBuffer, isOpen, position, putByte, putInt, releaseBuffer, resetBufferPositions, write_, write, write, write, write, writeIntflushBufferNonBlockingBase, getBytesWritten, getParkedThread, getParkNanosMax, getUnderlyingChannel, writeBuffer, writeBuffered, writeBufferNonBlockingclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitwrite, write, write, writeIntpublic ChannelBufferUnsafeDataOutputStream(WritableByteChannel channel)
public ChannelBufferUnsafeDataOutputStream(WritableByteChannel channel, int bufferSize)
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 writeShort(int v)
throws IOException
writeShort in interface DataOutputIOExceptionpublic final void writeChar(int v)
throws IOException
writeChar 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(@Nonnull String s) throws IOException
writeBytes in interface DataOutputIOExceptionpublic final void writeChars(@Nonnull String s) throws IOException
writeChars in interface DataOutputIOExceptionpublic final void writeUTF(@Nonnull String str) throws IOException
writeUTF in interface DataOutputIOExceptionpublic static long writeUTFSegmentNoOverflow(String str, int offset, int length, int utfLen, Object target, long addrPos)
protected static long putShort(long addrPos,
int v)
protected static long putLong(long addrPos,
long v)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.