public class PlatformOutputStreamImpl extends Object implements PlatformOutputStream
| Modifier and Type | Field and Description |
|---|---|
protected int |
cap
Maximum capacity.
|
protected long |
data
Pointer.
|
protected PlatformMemory |
mem
Underlying memory chunk.
|
protected int |
pos
Current position.
|
| Constructor and Description |
|---|
PlatformOutputStreamImpl(PlatformMemory mem)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
array() |
byte[] |
arrayCopy() |
void |
close()
Close the stream releasing resources.
|
protected void |
ensureCapacity(int reqCap)
Ensure capacity.
|
boolean |
hasArray() |
long |
offheapPointer() |
int |
position() |
void |
position(int pos) |
protected void |
shift(int cnt)
Shift position.
|
void |
synchronize()
Synchronize output stream with underlying memory
|
void |
unsafeEnsure(int cap)
Ensure capacity for unsafe writes.
|
void |
unsafePosition(int pos)
Set position in unsafe mode.
|
void |
unsafeWriteBoolean(boolean val)
Write boolean in unsafe mode.
|
void |
unsafeWriteByte(byte val)
Write byte in unsafe mode.
|
void |
unsafeWriteChar(char val)
Write char in unsafe mode.
|
void |
unsafeWriteDouble(double val)
Write double in unsafe mode.
|
void |
unsafeWriteFloat(float val)
Write float 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.
|
void |
write(byte[] arr,
int off,
int len)
Write byte array.
|
void |
write(long addr,
int cnt)
Write data from unmanaged memory.
|
void |
writeBoolean(boolean val)
Write boolean value.
|
void |
writeBooleanArray(boolean[] val)
Write boolean array.
|
void |
writeByte(byte val)
Write byte value.
|
void |
writeByteArray(byte[] val)
Write byte array.
|
void |
writeChar(char val)
Write char value.
|
void |
writeCharArray(char[] val)
Write char array.
|
void |
writeDouble(double val)
Write double value.
|
void |
writeDoubleArray(double[] val)
Write double array.
|
void |
writeFloat(float val)
Write float value.
|
void |
writeFloatArray(float[] val)
Write float array.
|
void |
writeInt(int val)
Write int value.
|
void |
writeInt(int pos,
int val)
Write int value to the given position.
|
void |
writeIntArray(int[] val)
Write int array.
|
void |
writeLong(long val)
Write long value.
|
void |
writeLongArray(long[] val)
Write long array.
|
void |
writeShort(int pos,
short val)
Write short value at the given position.
|
void |
writeShort(short val)
Write short value.
|
void |
writeShortArray(short[] val)
Write short array.
|
protected final PlatformMemory mem
protected long data
protected int cap
protected int pos
public PlatformOutputStreamImpl(PlatformMemory mem)
mem - Underlying memory chunk.public void writeByte(byte val)
writeByte in interface BinaryOutputStreamval - Byte value.public void writeByteArray(byte[] val)
writeByteArray in interface BinaryOutputStreamval - Byte array.public void writeBoolean(boolean val)
writeBoolean in interface BinaryOutputStreamval - Boolean value.public void writeBooleanArray(boolean[] val)
writeBooleanArray in interface BinaryOutputStreamval - Boolean array.public void writeShort(short val)
writeShort in interface BinaryOutputStreamval - Short value.public void writeShortArray(short[] val)
writeShortArray in interface BinaryOutputStreamval - Short array.public void writeChar(char val)
writeChar in interface BinaryOutputStreamval - Char value.public void writeCharArray(char[] val)
writeCharArray in interface BinaryOutputStreamval - Char array.public void writeInt(int val)
writeInt in interface BinaryOutputStreamval - Int value.public void writeIntArray(int[] val)
writeIntArray in interface BinaryOutputStreamval - Int array.public void writeShort(int pos,
short val)
writeShort in interface BinaryOutputStreampos - Position.val - Value.public void writeInt(int pos,
int val)
writeInt in interface BinaryOutputStreampos - Position.val - Value.public void writeFloat(float val)
writeFloat in interface BinaryOutputStreamval - Float value.public void writeFloatArray(float[] val)
writeFloatArray in interface BinaryOutputStreamval - Float array.public void writeLong(long val)
writeLong in interface BinaryOutputStreamval - Long value.public void writeLongArray(long[] val)
writeLongArray in interface BinaryOutputStreamval - Long array.public void writeDouble(double val)
writeDouble in interface BinaryOutputStreamval - Double value.public void writeDoubleArray(double[] val)
writeDoubleArray in interface BinaryOutputStreamval - Double array.public void write(byte[] arr,
int off,
int len)
write in interface BinaryOutputStreamarr - Array.off - Offset.len - Length.public void write(long addr,
int cnt)
write in interface BinaryOutputStreamaddr - Address.cnt - Count.public int position()
position in interface BinaryStreampublic void position(int pos)
position in interface BinaryStreampos - Position.public void close()
close in interface AutoCloseableclose in interface BinaryOutputStreampublic byte[] array()
array in interface BinaryStreampublic byte[] arrayCopy()
arrayCopy in interface BinaryStreampublic long offheapPointer()
offheapPointer in interface BinaryStream0.public boolean hasArray()
hasArray in interface BinaryStreamTrue is stream is array based.public void unsafeEnsure(int cap)
unsafeEnsure in interface BinaryOutputStreamcap - Capacity.public void unsafePosition(int pos)
unsafePosition in interface BinaryOutputStreampos - Position.public void unsafeWriteByte(byte val)
unsafeWriteByte in interface BinaryOutputStreamval - Value.public void unsafeWriteBoolean(boolean val)
unsafeWriteBoolean in interface BinaryOutputStreamval - Value.public void unsafeWriteShort(short val)
unsafeWriteShort in interface BinaryOutputStreamval - Value.public void unsafeWriteShort(int pos,
short val)
unsafeWriteShort in interface BinaryOutputStreampos - Position.val - Value.public void unsafeWriteChar(char val)
unsafeWriteChar in interface BinaryOutputStreamval - Value.public void unsafeWriteInt(int val)
unsafeWriteInt in interface BinaryOutputStreamval - Value.public void unsafeWriteInt(int pos,
int val)
unsafeWriteInt in interface BinaryOutputStreampos - Position.val - Value.public void unsafeWriteLong(long val)
unsafeWriteLong in interface BinaryOutputStreamval - Value.public void unsafeWriteFloat(float val)
unsafeWriteFloat in interface BinaryOutputStreamval - Value.public void unsafeWriteDouble(double val)
unsafeWriteDouble in interface BinaryOutputStreamval - Value.public void synchronize()
synchronize in interface PlatformOutputStreamprotected void ensureCapacity(int reqCap)
reqCap - Required byte count.protected void shift(int cnt)
cnt - Byte count.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.7.0 Release Date : August 1 2016