|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjlibs.core.lang.ByteSequence
public class ByteSequence
This class represents a sequence of bytes.
| Constructor Summary | |
|---|---|
ByteSequence(byte[] buff)
Allocates a new ByteSequence so that it represents the sequence of
bytes currently contained in the byte array argument. |
|
ByteSequence(byte[] buff,
int offset,
int length)
Allocates a new ByteSequence that contains characters from a subarray
of the byte array argument. |
|
| Method Summary | |
|---|---|
ByteArrayInputStream |
asInputStream()
|
byte[] |
buffer()
returns the byte buffer used by this instance |
byte |
byteAt(int index)
|
ByteSequence |
copy()
|
int |
length()
|
int |
offset()
returns the index of first byte in byte buffer |
void |
set(byte[] buff,
int offset,
int length)
replaces the internal byte buffer with the given byte array. |
ByteSequence |
slice(int offset)
|
ByteSequence |
slice(int offset,
int length)
|
byte[] |
toByteArray(boolean clone)
|
ByteBuffer |
toByteBuffer()
|
String |
toString()
|
String |
toString(Charset charset)
|
String |
toString(String charset)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ByteSequence(byte[] buff)
ByteSequence so that it represents the sequence of
bytes currently contained in the byte array argument. The
contents of the byte array are not copied;
buff - value of the bytesequence
public ByteSequence(byte[] buff,
int offset,
int length)
ByteSequence that contains characters from a subarray
of the byte array argument. The offset argument is the
index of the first byte of the subarray and the length
argument specifies the length of the subarray. The contents of the
subarray are not copied;
buff - Array that is the source of bytesoffset - The initial offsetlength - The length
IndexOutOfBoundsException - If the offset and length arguments index
bytes outside the bounds of the buff array| Method Detail |
|---|
public void set(byte[] buff,
int offset,
int length)
buff - Array that is the source of bytesoffset - The initial offsetlength - The lengthpublic byte byteAt(int index)
public byte[] buffer()
public int offset()
public int length()
public ByteSequence slice(int offset)
public ByteSequence slice(int offset,
int length)
public ByteBuffer toByteBuffer()
public byte[] toByteArray(boolean clone)
public ByteArrayInputStream asInputStream()
public String toString(Charset charset)
public String toString(String charset)
throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic String toString()
toString in class Objectpublic ByteSequence copy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||