|
||||||||||
| 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(Object obj)
|
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 null
public ByteArray(byte[] data,
int offset,
int length)
data - may be null but why would you do that| Method 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 Objectpublic final int compareTo(Object obj)
compareTo in interface Comparablepublic final int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic final String toBase64()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||