|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.data.ByteArray
public class ByteArray
Wrap up an array of bytes so that they can be compared and placed in hashes, maps, and the like.
Constructor Summary | |
---|---|
ByteArray()
|
|
ByteArray(byte[] data)
Sets valid = data.length, unless data is null Sets offset = 0 |
|
ByteArray(byte[] data,
int offset,
int length)
Sets offset = offset Sets valid = length |
Method Summary | |
---|---|
int |
compareTo(ByteArray ba)
|
boolean |
equals(Object o)
|
byte[] |
getData()
|
int |
getOffset()
|
int |
getValid()
Count how many of the bytes in the array are 'valid'. |
int |
hashCode()
|
void |
setData(byte[] data)
Warning, does not set valid |
void |
setOffset(int offset)
|
void |
setValid(int valid)
|
String |
toBase64()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ByteArray()
public ByteArray(byte[] data)
data
- may be nullpublic ByteArray(byte[] data, int offset, int length)
data
- may be null but why would you do thatMethod Detail |
---|
public byte[] getData()
public void setData(byte[] data)
public int getValid()
public void setValid(int valid)
public int getOffset()
public void setOffset(int offset)
public final boolean equals(Object o)
equals
in class Object
public final int compareTo(ByteArray ba)
compareTo
in interface Comparable<ByteArray>
public final int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public final String toBase64()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |