public interface NativeBuffer extends DataInput, DataOutput
| Modifier and Type | Method and Description |
|---|---|
long |
capacity()
Returns the size of backing NativeMemory.
|
long |
getOffset()
Returns the offset of this NativeBuffer in its backing NativeMemory.
|
long |
getPosition()
Returns the number of bytes written to this native buffer
|
long |
getStartOffset()
Returns the offset of this NativeBuffer in its backing NativeMemory that it would have after a call to setPosition(0).
|
NativeMemory |
memory()
Returns the memory that this NativeBuffer backs or null if it is not backed by NativeMemory.
|
boolean |
readBoolean() |
byte |
readByte() |
char |
readChar() |
double |
readDouble() |
float |
readFloat() |
void |
readFully(byte[] b) |
void |
readFully(byte[] b,
int off,
int len) |
int |
readInt() |
String |
readLine() |
long |
readLong() |
short |
readShort() |
int |
readUnsignedByte() |
int |
readUnsignedShort() |
String |
readUTF() |
String |
readZeroTerminatedUTF8()
the returned string does not end with the 0 byte.
|
long |
remaining()
Returns the exact number of bytes that can be read from this NativeBuffer.
|
boolean |
setOffset(long offset)
Change the offset in the native memory.
|
boolean |
setPosition(long position)
Changes the offset so that getPosition() would return the given number.
|
int |
skipBytes(int n) |
void |
write(byte[] b) |
void |
write(byte[] b,
int off,
int len) |
void |
write(byte value,
long len)
writes the value 'value' len times.
|
void |
write(int b) |
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 s) |
void |
writeZeroTerminatedUTF8(String str)
Writes a zero terminated utf8 string.
|
void write(int b)
write in interface DataOutputvoid write(byte[] b)
write in interface DataOutputvoid write(byte[] b,
int off,
int len)
write in interface DataOutputvoid writeBoolean(boolean v)
writeBoolean in interface DataOutputvoid writeByte(int v)
writeByte in interface DataOutputvoid writeShort(int v)
writeShort in interface DataOutputvoid writeChar(int v)
writeChar in interface DataOutputvoid writeInt(int v)
writeInt in interface DataOutputvoid writeLong(long v)
writeLong in interface DataOutputvoid writeFloat(float v)
writeFloat in interface DataOutputvoid writeDouble(double v)
writeDouble in interface DataOutputvoid writeBytes(String s)
writeBytes in interface DataOutputvoid writeChars(String s)
writeChars in interface DataOutputvoid writeUTF(String s)
writeUTF in interface DataOutputboolean readBoolean()
readBoolean in interface DataInputint readUnsignedByte()
readUnsignedByte in interface DataInputint readUnsignedShort()
readUnsignedShort in interface DataInputdouble readDouble()
readDouble in interface DataInputString readZeroTerminatedUTF8()
void writeZeroTerminatedUTF8(String str)
str - should not contain or end with the '0' byte character.void write(byte value,
long len)
NativeMemory memory()
long getOffset()
getPosition() for that.
Returns -1 in case a call to memory() would return null;long getPosition()
long remaining()
long capacity()
long getStartOffset()
NativeBuffer does not support setting positions.
This call does not modify any offsets/positions of the NativeBuffer.boolean setPosition(long position)
NativeBuffer does not support setting positions. In that case the call was a noop.boolean setOffset(long offset)
NativeBuffer does not support setting positions. In this case the call was a noop.Copyright © 2023. All rights reserved.