public static class ByteString.Concrete extends ByteString implements java.io.Serializable
ByteString.Concrete, ByteString.Empty, ByteString.SubString, ByteString.TrSubString
Modifier and Type | Field and Description |
---|---|
protected byte[] |
ba_
Storage for the data
|
nada
Modifier | Constructor and Description |
---|---|
|
Concrete(byte[] ba,
boolean share)
Constructs a new
ByteString initialized to
contain the same sequence of bytes as the contained in
the byte array argument. |
protected |
Concrete(ByteString.Concrete bs,
boolean share)
Copy constuctor.
|
|
Concrete(ByteString bs)
Copy constuctor.
|
|
Concrete(ByteString bs,
int length)
Copy constuctor which trims input to length.
|
|
Concrete(ByteString bs,
int origin,
int length)
Copy constuctor which trims input to
[origin, origin + length).
|
|
Concrete(java.lang.String str)
Construct a ByteString by narrowing a String.
|
Modifier and Type | Method and Description |
---|---|
byte |
byteAt(int ii)
_more_
|
byte[] |
copyBytes(int srcpos,
byte[] dst,
int dstpos,
int nbytes)
_more_
|
int |
getLength()
_more_
|
ByteString |
subByteString(int beginIndex,
int length)
_more_
|
ByteString |
substring(int beginIndex)
_more_
|
byte[] |
toArray()
_more_
|
public Concrete(byte[] ba, boolean share)
ByteString
initialized to
contain the same sequence of bytes as the contained in
the byte array argument. If share
is
true
then the byte array argument is used
as backing storage. Caution: in this case, subsequent
modification of the byte array affects the newly created
ByteString. Otherwise, the contents of the byte array
are copied and subsequent modification of the byte array
does not affect the newly created ByteString.ba
- byte array which initializes contents of thisshare
- boolean, if false, make a private copy of bapublic Concrete(ByteString bs)
bs
- protected Concrete(ByteString.Concrete bs, boolean share)
bs
- share
- public Concrete(ByteString bs, int length)
bs
- length
- public Concrete(ByteString bs, int origin, int length)
bs
- origin
- length
- public Concrete(java.lang.String str)
str
- public int getLength()
getLength
in class ByteString
public byte byteAt(int ii)
byteAt
in class ByteString
ii
- public byte[] copyBytes(int srcpos, byte[] dst, int dstpos, int nbytes)
copyBytes
in class ByteString
srcpos
- dst
- dstpos
- nbytes
- public byte[] toArray()
toArray
in class ByteString
public ByteString subByteString(int beginIndex, int length)
subByteString
in class ByteString
beginIndex
- length
- public ByteString substring(int beginIndex)
substring
in class ByteString
beginIndex
- String.substring(int)