public class ByteString
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
base |
protected int |
len |
protected int |
pos |
Modifier and Type | Method and Description |
---|---|
static int |
convertToInt(byte[] b,
int start,
int end)
Convert the literal representation of an int to its int value
|
int |
convertToInt(int start)
Convert the literal representation of an int to its int value
|
static ByteString |
copy(ByteString source)
Copy - if the source is null, this returns null.
|
boolean |
equalsAtIgnoreCase(byte[] b,
int at)
Check if this ByteString equals the byte array
b ,
for the length of the byte array, starting at at
within this ByteString. |
boolean |
equalsIgnoreCase(byte[] b,
int pos,
int len)
Check if this ByteString equals the value of the passed arguments
|
boolean |
equalsIgnoreCase(ByteString c)
Check if this ByteString is equal to the one passed in the argument.
|
int |
indexOf(byte[] b,
int start)
Find the first byte array
b in this ByteString. |
int |
indexOf(byte b,
int start)
Find the first byte
b in this ByteString. |
int |
lastIndexOf(byte b)
Find the last byte
b in this ByteString. |
ByteString |
substring(int start,
int end)
Creates a ByteString substring.
|
java.lang.String |
toString()
Return a String representation of this ByteString
|
public static ByteString copy(ByteString source)
source
- ByteString to be copiedpublic ByteString substring(int start, int end)
start
- the first character of the substringend
- the character after the last character of the substringpublic final boolean equalsIgnoreCase(byte[] b, int pos, int len)
b
- byte array that holds the value to check againstpos
- first byte in the byte arraylen
- length of the value to check againstpublic final boolean equalsIgnoreCase(ByteString c)
c
- ByteString to check againstc
ByteString, false otherwise.public final boolean equalsAtIgnoreCase(byte[] b, int at)
b
,
for the length of the byte array, starting at at
within this ByteString.
This extends, some how, startsWidth and endsWidth, avoiding substring.
b
- byte array that holds the value to check againstat
- first byte in this ByteStringpublic final java.lang.String toString()
toString
in class java.lang.Object
public final int indexOf(byte b, int start)
b
in this ByteString.b
- byte to findstart
- where to start frompublic final int lastIndexOf(byte b)
b
in this ByteString.b
- byte to findpublic final int indexOf(byte[] b, int start)
b
in this ByteString.b
- byte array to findstart
- where to start frompublic static int convertToInt(byte[] b, int start, int end)
b
- byte array that holds the literal representationstart
- where it starts in the byte arrayend
- where it endspublic int convertToInt(int start)
start
- where the int represenation starts in this ByteString