public final class PortableHeapOutputStream extends PortableAbstractOutputStream
BOOLEAN_ARR_OFF, BYTE_ARR_OFF, BYTE_ONE, BYTE_ZERO, CHAR_ARR_OFF, DOUBLE_ARR_OFF, FLOAT_ARR_OFF, INT_ARR_OFF, LITTLE_ENDIAN, LONG_ARR_OFF, pos, SHORT_ARR_OFF, UNSAFE| Constructor and Description |
|---|
PortableHeapOutputStream(int cap)
Constructor.
|
PortableHeapOutputStream(int cap,
PortableMemoryAllocatorChunk chunk)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array() |
byte[] |
arrayCopy() |
void |
close()
Close the stream releasing resources.
|
protected void |
copyAndShift(Object src,
long off,
int len)
Copy source object to the stream shift position afterwards.
|
void |
ensureCapacity(int cnt)
Ensure capacity.
|
boolean |
hasArray() |
void |
unsafeWriteByte(byte val)
Write byte in unsafe mode.
|
void |
unsafeWriteChar(char val)
Write char in unsafe mode.
|
void |
unsafeWriteInt(int val)
Write int in unsafe mode.
|
void |
unsafeWriteInt(int pos,
int val)
Write int in unsafe mode.
|
void |
unsafeWriteLong(long val)
Write long in unsafe mode.
|
void |
unsafeWriteShort(int pos,
short val)
Write short in unsafe mode.
|
void |
unsafeWriteShort(short val)
Write short in unsafe mode.
|
protected void |
writeByteAndShift(byte val)
Write next byte to the stream.
|
protected void |
writeCharFast(char val)
Write char value (fast path).
|
protected void |
writeIntFast(int val)
Write int value (fast path).
|
protected void |
writeLongFast(long val)
Write long value (fast path).
|
protected void |
writeShortFast(short val)
Write short value (fast path).
|
capacity, offheapPointer, position, unsafeEnsure, unsafePosition, unsafeWriteBoolean, unsafeWriteDouble, unsafeWriteFloat, write, write, writeBoolean, writeBooleanArray, writeByte, writeByteArray, writeChar, writeCharArray, writeDouble, writeDoubleArray, writeFloat, writeFloatArray, writeInt, writeInt, writeIntArray, writeLong, writeLongArray, writeShort, writeShort, writeShortArrayposition, shiftclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpositionpublic PortableHeapOutputStream(int cap)
cap - Initial capacity.public PortableHeapOutputStream(int cap,
PortableMemoryAllocatorChunk chunk)
cap - Capacity.chunk - Chunk.public void close()
public void ensureCapacity(int cnt)
ensureCapacity in class PortableAbstractOutputStreamcnt - Required byte count.public byte[] array()
public byte[] arrayCopy()
public boolean hasArray()
True is stream is array based.protected void writeByteAndShift(byte val)
writeByteAndShift in class PortableAbstractOutputStreamval - Value.protected void copyAndShift(Object src, long off, int len)
copyAndShift in class PortableAbstractOutputStreamsrc - Source.off - Offset.len - Length.protected void writeShortFast(short val)
writeShortFast in class PortableAbstractOutputStreamval - Short value.protected void writeCharFast(char val)
writeCharFast in class PortableAbstractOutputStreamval - Char value.protected void writeIntFast(int val)
writeIntFast in class PortableAbstractOutputStreamval - Int value.protected void writeLongFast(long val)
writeLongFast in class PortableAbstractOutputStreamval - Long value.public void unsafeWriteByte(byte val)
val - Value.public void unsafeWriteShort(short val)
val - Value.public void unsafeWriteShort(int pos,
short val)
pos - Position.val - Value.public void unsafeWriteChar(char val)
val - Value.public void unsafeWriteInt(int val)
val - Value.public void unsafeWriteInt(int pos,
int val)
pos - Position.val - Value.public void unsafeWriteLong(long val)
val - Value.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.0-b1 Release Date : December 1 2015