public class TPSBuffer
extends java.lang.Object
Constructor and Description |
---|
TPSBuffer()
Creates an empty Buffer.
|
TPSBuffer(byte b)
Creates a buffer from only one byte
|
TPSBuffer(byte[] inBuf)
Creates a Buffer of length 'len', initialized from 'buf'.
|
TPSBuffer(int len)
Creates a Buffer of length 'len', initialized to zeroes.
|
TPSBuffer(int len,
byte b)
Creates a Buffer of length 'len', with each byte initialized to 'b'.
|
TPSBuffer(java.lang.String str) |
TPSBuffer(TPSBuffer cpy) |
Modifier and Type | Method and Description |
---|---|
void |
add(byte b)
Append operators.
|
void |
add(TPSBuffer addend) |
void |
addBytes(byte[] addBytes) |
void |
addInt2Bytes(int value) |
void |
addLong4Bytes(long value) |
byte |
at(int i) |
void |
dump()
dump()s this Buffer to stdout.
|
boolean |
equals(TPSBuffer cmp)
Returns true if the two buffers are the same length and contain
the same byte at each offset.
|
int |
getIntFrom1Byte(int offset) |
int |
getIntFrom2Bytes(int offset) |
long |
getLongFrom4Bytes(int offset) |
static void |
main(java.lang.String[] args) |
void |
prepend(TPSBuffer prepend) |
void |
prependBytes(byte[] preBytes) |
void |
reset() |
void |
resize(int newLen)
Changes the length of the Buffer.
|
void |
set(byte[] newContents) |
void |
set(TPSBuffer newContents) |
void |
setAt(int i,
byte value) |
int |
size()
The length of buffer.
|
TPSBuffer |
substr(int start)
Get the SubString from start to the end
|
TPSBuffer |
substr(int start,
int theLen)
Returns a new Buffer that is a substring of this Buffer, starting
from offset 'start' and continuing for 'len' bytes.
|
byte[] |
toBytesArray() |
java.lang.String |
toHexString() |
java.lang.String |
toHexStringPlain() |
void |
zeroize()
Sets all bytes in the buffer to 0.
|
public TPSBuffer()
public TPSBuffer(java.lang.String str)
public TPSBuffer(int len, byte b)
public TPSBuffer(byte b)
b
- public TPSBuffer(int len)
public TPSBuffer(byte[] inBuf)
public TPSBuffer(TPSBuffer cpy)
public byte at(int i)
public void setAt(int i, byte value)
public boolean equals(TPSBuffer cmp)
public void prepend(TPSBuffer prepend)
public void add(TPSBuffer addend)
public void set(TPSBuffer newContents)
public void set(byte[] newContents)
public void add(byte b)
public void prependBytes(byte[] preBytes)
public void addBytes(byte[] addBytes)
public byte[] toBytesArray()
public int size()
public void zeroize()
public void resize(int newLen)
public TPSBuffer substr(int start, int theLen)
public TPSBuffer substr(int start)
start
- public void dump()
public java.lang.String toHexString()
public java.lang.String toHexStringPlain()
public int getIntFrom1Byte(int offset)
public int getIntFrom2Bytes(int offset)
public void addLong4Bytes(long value)
public void addInt2Bytes(int value)
public long getLongFrom4Bytes(int offset)
public void reset()
public static void main(java.lang.String[] args)