|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.tomcat.util.buf.MessageBytes
This class is used to represent a subarray of bytes in an HTTP message.
Nested Class Summary | |
static class |
MessageBytes.MessageBytesFactory
|
Field Summary | |
static int |
T_BYTES
|
static int |
T_CHARS
|
static int |
T_NULL
|
static int |
T_STR
|
Constructor Summary | |
MessageBytes()
Creates a new, uninitialized MessageBytes object. |
Method Summary | |
void |
duplicate(MessageBytes src)
Copy the src into this MessageBytes, allocating more space if needed |
boolean |
equals(MessageBytes mb)
|
boolean |
equals(java.lang.String s)
Compares the message bytes to the specified String object. |
boolean |
equalsIgnoreCase(java.lang.String s)
Compares the message bytes to the specified String object. |
ByteChunk |
getByteChunk()
Returns the message bytes. |
CharChunk |
getCharChunk()
|
MessageBytes |
getClone()
|
int |
getInt()
Deprecated. The buffer are general purpose, caching for headers should be done in headers |
int |
getLength()
Returns the length of the buffer. |
java.lang.String |
getString()
|
long |
getTime()
Deprecated. The buffer are general purpose, caching for headers should be done in headers |
int |
getType()
|
int |
hashCode()
|
int |
indexOf(char c)
|
int |
indexOf(char c,
int starting)
Returns true if the message bytes starts with the specified string. |
int |
indexOf(java.lang.String s)
|
int |
indexOf(java.lang.String s,
int starting)
|
int |
indexOfIgnoreCase(java.lang.String s,
int starting)
|
boolean |
isNull()
|
static MessageBytes |
newInstance()
|
void |
recycle()
Resets the message bytes to an uninitialized state. |
void |
resetStringValue()
Remove the cached string value. |
void |
setBytes(byte[] b,
int off,
int len)
Sets the message bytes to the specified subarray of bytes. |
void |
setCaseSenitive(boolean b)
|
void |
setChars(char[] c,
int off,
int len)
|
void |
setEncoding(java.lang.String enc)
|
static void |
setFactory(MessageBytes.MessageBytesFactory mbf)
|
void |
setInt(int i)
Deprecated. The buffer are general purpose, caching for headers should be done in headers |
void |
setString(java.lang.String s)
|
void |
setTime(long t)
|
void |
setTime(long t,
java.text.DateFormat df)
Deprecated. The buffer are general purpose, caching for headers should be done in headers. The second parameter allows us to pass a date format instance to avoid synchronization problems. |
boolean |
startsWith(java.lang.String s)
Returns true if the message bytes starts with the specified string. |
boolean |
startsWithIgnoreCase(java.lang.String s,
int pos)
Returns true if the message bytes starts with the specified string. |
void |
toBytes()
|
void |
toChars()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int T_NULL
public static final int T_STR
public static final int T_BYTES
public static final int T_CHARS
Constructor Detail |
public MessageBytes()
Method Detail |
public static MessageBytes newInstance()
public void setCaseSenitive(boolean b)
public MessageBytes getClone()
public boolean isNull()
public void recycle()
public void setBytes(byte[] b, int off, int len)
b
- the ascii bytesoff
- the start offset of the byteslen
- the length of the bytespublic void setEncoding(java.lang.String enc)
public void setChars(char[] c, int off, int len)
public void resetStringValue()
public void setString(java.lang.String s)
public java.lang.String toString()
public int getType()
public ByteChunk getByteChunk()
public CharChunk getCharChunk()
public java.lang.String getString()
public void toBytes()
public void toChars()
public int getLength()
public 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(MessageBytes mb)
public boolean startsWith(java.lang.String s)
s
- the stringpublic boolean startsWithIgnoreCase(java.lang.String s, int pos)
s
- the stringpublic int hashCode()
public int indexOf(char c)
public int indexOf(java.lang.String s, int starting)
public int indexOf(java.lang.String s)
public int indexOfIgnoreCase(java.lang.String s, int starting)
public int indexOf(char c, int starting)
public void duplicate(MessageBytes src) throws java.io.IOException
java.io.IOException
public void setTime(long t, java.text.DateFormat df)
public void setTime(long t)
public void setInt(int i)
public long getTime()
public int getInt()
public static void setFactory(MessageBytes.MessageBytesFactory mbf)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |