|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.judoscript.util.Ascii
com.judoscript.util.MsgBytes
public class MsgBytes
This class is used to represent a subarray of bytes in an HTTP message.
Field Summary | |
---|---|
protected byte[] |
bytes
|
protected int |
length
|
protected int |
offset
|
Constructor Summary | |
---|---|
MsgBytes()
|
|
MsgBytes(byte[] b,
int off,
int len)
|
Method Summary | |
---|---|
boolean |
equals(byte[] b,
int off,
int len)
Compares the message bytes to the specified subarray of bytes. |
boolean |
equals(java.lang.String s)
Compares the message bytes to the specified String object. |
boolean |
equalsIgnoreCase(byte[] b,
int off,
int len)
Compares the message bytes to the specified subarray of bytes. |
boolean |
equalsIgnoreCase(java.lang.String s)
Compares the message bytes to the specified String object. |
byte[] |
getBytes()
|
int |
getBytes(byte[] buf,
int buf_offset)
Puts the message bytes in buf starting at buf_offset. |
byte[] |
getEffectiveBytes()
|
MsgBytes |
getEffectiveMsgBytes()
|
int |
getLength()
|
int |
getOffset()
|
int |
indexOf(int c)
|
int |
indexOf(int index,
int c)
|
int |
indexOf(int index,
java.lang.String s)
|
int |
indexOf(java.lang.String s)
|
int |
indexOfIgnoreCase(int index,
java.lang.String s)
|
int |
indexOfIgnoreCase(java.lang.String s)
|
boolean |
isSet()
|
int |
length()
|
void |
reset()
|
void |
setBytes(byte[] b,
int off,
int len)
|
void |
setOffset(int ofst)
Sets the new offset. |
void |
skip(int distance)
|
boolean |
startsWith(int index,
java.lang.String s)
|
boolean |
startsWith(java.lang.String s)
Returns true if the message bytes starts with the specified string. |
boolean |
startsWithIgnoreCase(int index,
java.lang.String s)
|
boolean |
startsWithIgnoreCase(java.lang.String s)
|
java.lang.String |
substring(int idx,
int len)
|
long |
toDate(HttpDate d)
Returns the message bytes parsed as a date. |
int |
toInteger()
Returns the message bytes parsed as an unsigned integer. |
java.lang.String |
toString()
|
void |
write(java.io.OutputStream out)
Writes the message bytes to the specified output stream. |
Methods inherited from class com.judoscript.util.Ascii |
---|
isAlpha, isDigit, isLower, isUpper, isWhite, parseInt, toLower, toUpper |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected byte[] bytes
protected int offset
protected int length
Constructor Detail |
---|
public MsgBytes()
public MsgBytes(byte[] b, int off, int len)
Method Detail |
---|
public void reset()
public void setBytes(byte[] b, int off, int len)
public int getBytes(byte[] buf, int buf_offset)
public byte[] getBytes()
public int getOffset()
public int getLength()
public boolean isSet()
public java.lang.String toString()
toString
in class java.lang.Object
public int length()
public int toInteger() throws java.lang.NumberFormatException
java.lang.NumberFormatException
- if the integer format was invalidpublic long toDate(HttpDate d) throws java.lang.IllegalArgumentException
d
- the HttpDate object to use for parsing
java.lang.IllegalArgumentException
- if the date format was invalidpublic boolean equals(java.lang.String s)
s
- the String to compare
public boolean equalsIgnoreCase(java.lang.String s)
s
- the String to compare
public boolean equals(byte[] b, int off, int len)
b
- the bytes to compareoff
- the start offset of the byteslen
- the length of the bytes
public boolean equalsIgnoreCase(byte[] b, int off, int len)
b
- the bytes to compareoff
- the start offset of the byteslen
- the length of the bytes
public boolean startsWith(java.lang.String s)
s
- the stringpublic void write(java.io.OutputStream out) throws java.io.IOException
out
- the output stream
java.io.IOException
- if an I/O error has occurredpublic void setOffset(int ofst)
public void skip(int distance)
public boolean startsWithIgnoreCase(java.lang.String s)
public boolean startsWith(int index, java.lang.String s)
public boolean startsWithIgnoreCase(int index, java.lang.String s)
public int indexOf(int index, java.lang.String s)
public int indexOf(java.lang.String s)
public int indexOfIgnoreCase(int index, java.lang.String s)
public int indexOfIgnoreCase(java.lang.String s)
public int indexOf(int index, int c)
public int indexOf(int c)
public java.lang.String substring(int idx, int len)
public byte[] getEffectiveBytes()
public MsgBytes getEffectiveMsgBytes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |