Constructor and Description |
---|
XDROutputBuffer(int BUFFER_SIZE) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBuffer()
Return the backing byte[] buffer.
|
int |
getLength()
Return the #of bytes written onto the buffer.
|
void |
reset()
Reset the buffer (clears the offset of the next byte to be written to
zero).
|
void |
writeDouble(double d)
Puts a double into the buffer as 8 bytes, big-endian.
|
void |
writeFloat(float f)
Puts a float into the buffer as 4 bytes, big-endian.
|
void |
writeInt(int i)
Puts an integer into the buffer as 4 bytes, big-endian.
|
void |
writeLong(long i)
Puts a long into the buffer as 8 bytes, big-endian.
|
void |
writeShort(short i)
Puts a short integer into the buffer as 2 bytes, big-endian but w/
leading zeros (e.g., as if an int32 value).
|
void |
writeString(String s)
Puts a string into the buffer by first writing the size of the string as
an int, followed by the bytes of the string, padded if necessary to a
multiple of 4.
|
public XDROutputBuffer(int BUFFER_SIZE)
BUFFER_SIZE
- The size of the fixed capacity buffer.public void reset()
public byte[] getBuffer()
public int getLength()
public void writeString(String s)
public void writeShort(short i)
cpu_num
is reported as ushort.public void writeInt(int i)
public void writeLong(long i)
public void writeFloat(float f)
public void writeDouble(double d)
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.