## net.i2p.data
Class ByteArray

    java.lang.Object
      net.i2p.data.ByteArray

All Implemented Interfaces:
  java.io.Serializable, java.lang.Comparable

Direct Known Subclasses:
  SessionTag

    public class ByteArray

extends java.lang.Object
implements java.io.Serializable, java.lang.Comparable

Wrap up an array of bytes so that they can be compared and placed in hashes, maps, and the like.

See Also:
  Serialized Form

Constructor Summary
`ByteArray()`
`ByteArray(byte[] data)`
`ByteArray(byte[] data, int offset, int length)`

Method Summary
`int` `compareTo(java.lang.Object obj)`
`boolean` `equals(java.lang.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)`
`void` `setOffset(int offset)`
`void` `setValid(int valid)`
`java.lang.String` `toBase64()`
`java.lang.String` `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### ByteArray

    public ByteArray()

### ByteArray

    public ByteArray(byte[] data)

### ByteArray

    public ByteArray(byte[] data,
                     int offset,
                     int length)

Method Detail

### getData

    public byte[] getData()

### setData

    public void setData(byte[] data)

### getValid

    public int getValid()

  Count how many of the bytes in the array are 'valid'. this property does not necessarily have meaning for all byte arrays.

### setValid

    public void setValid(int valid)

### getOffset

    public int getOffset()

### setOffset

    public void setOffset(int offset)

### equals

    public final boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### compareTo

    public final int compareTo(java.lang.Object obj)

  Specified by:
    `compareTo` in interface `java.lang.Comparable`

### hashCode

    public final int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### toBase64

    public final java.lang.String toBase64()