|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jkristian.lang.ByteArraySequence
public class ByteArraySequence
A ByteSequence that simply contains an array of bytes. The array is referenced, not copied; so changes to the array are visible via the containing object.
| Constructor Summary | |
|---|---|
ByteArraySequence(byte[] data)
|
|
| Method Summary | |
|---|---|
byte |
byteAt(int index)
|
static ByteArraySequence |
copy(byte[] data)
Copy the given data into a new ByteArraySequence. |
static ByteArraySequence |
copy(byte[] data,
int start,
int end)
Copy the given data into a new ByteArraySequence. |
static ByteArraySequence |
copy(ByteSequence data)
Copy the given data into a new ByteArraySequence. |
static ByteArraySequence |
copy(ByteSequence data,
int start,
int end)
Copy the given data into a new ByteArraySequence. |
void |
copy(int start,
int end,
byte[] into)
Copy a sub-sequence into a given array. |
void |
copy(int start,
int end,
byte[] into,
int intoStart)
Copy a sub-sequence into a given array. |
boolean |
equals(java.lang.Object that)
|
int |
hashCode()
|
int |
length()
|
ByteSequence |
subSequence(int start,
int end)
Create a read-only view of this sequence. |
byte[] |
toByteArray()
Copy this sequence into a new array. |
byte[] |
toByteArray(int start,
int end)
Copy a sub-sequence into a new array. |
java.lang.String |
toString()
|
java.lang.String |
toString(int start,
int end,
java.lang.String encoding)
new String(toByteArray(start, end), encoding) |
java.lang.String |
toString(java.lang.String encoding)
toString(0, length(), encoding) |
void |
writeTo(int start,
int end,
java.io.OutputStream out)
Copy a sub-sequence into an OutputStream. |
void |
writeTo(java.io.OutputStream out)
Copy this sequence into an OutputStream. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ByteArraySequence(byte[] data)
| Method Detail |
|---|
public static ByteArraySequence copy(byte[] data)
copy(data, 0, data.length).
public static ByteArraySequence copy(byte[] data,
int start,
int end)
public static ByteArraySequence copy(ByteSequence data)
copy(data, 0, data.length()).
public static ByteArraySequence copy(ByteSequence data,
int start,
int end)
public int length()
length in interface ByteSequencepublic byte byteAt(int index)
byteAt in interface ByteSequence
public void copy(int start,
int end,
byte[] into)
ByteSequencecopy(start, end, into, 0).
copy in interface ByteSequence
public void copy(int start,
int end,
byte[] into,
int intoStart)
ByteSequence
copy in interface ByteSequencepublic byte[] toByteArray()
ByteSequencetoByteArray(0, length()).
toByteArray in interface ByteSequence
public byte[] toByteArray(int start,
int end)
ByteSequence
toByteArray in interface ByteSequencepublic java.lang.String toString()
toString in class java.lang.Object
public java.lang.String toString(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
ByteSequence
toString in interface ByteSequencejava.io.UnsupportedEncodingException
public java.lang.String toString(int start,
int end,
java.lang.String encoding)
throws java.io.UnsupportedEncodingException
ByteSequence
toString in interface ByteSequencejava.io.UnsupportedEncodingException
public void writeTo(java.io.OutputStream out)
throws java.io.IOException
ByteSequencewriteTo(0,
length(), out).
writeTo in interface ByteSequencejava.io.IOException
public void writeTo(int start,
int end,
java.io.OutputStream out)
throws java.io.IOException
ByteSequence
writeTo in interface ByteSequencejava.io.IOException
public ByteSequence subSequence(int start,
int end)
ByteSequenceThe returned sequence shares this sequence's content; that is, any changes to the bytes in the given range of this sequence will be visible in the sub-sequence.
subSequence in interface ByteSequencepublic boolean equals(java.lang.Object that)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||