org.apache.tomcat.util.buf
public final class MessageBytes extends Object implements Cloneable, Serializable
Nested Class Summary | |
---|---|
static class | MessageBytes.MessageBytesFactory |
Field Summary | |
---|---|
static int | T_BYTES getType() is T_STR if the the object used to create the MessageBytes
was a byte[] |
static int | T_CHARS getType() is T_STR if the the object used to create the MessageBytes
was a char[] |
static int | T_NULL |
static int | T_STR getType() is T_STR if the the object used to create the MessageBytes
was a String |
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(String s)
Compares the message bytes to the specified String object. |
boolean | equals(MessageBytes mb) |
boolean | equalsIgnoreCase(String s)
Compares the message bytes to the specified String object. |
ByteChunk | getByteChunk()
Returns the byte chunk, representing the byte[] and offset/length.
|
CharChunk | getCharChunk()
Returns the char chunk, representing the char[] and offset/length.
|
MessageBytes | getClone() |
int | getInt() Convert the buffer to an int, cache the value |
int | getLength()
Returns the length of the original buffer.
|
long | getLong() Convert the buffer to an long, cache the value |
String | getString()
Returns the string value.
|
long | getTime() |
int | getType() Return the type of the original content. |
int | hashCode() |
int | indexOf(char c) |
int | indexOf(String s, int starting) |
int | indexOf(String s) |
int | indexOf(char c, int starting)
Returns true if the message bytes starts with the specified string. |
int | indexOfIgnoreCase(String s, int starting) |
boolean | isNull() |
static MessageBytes | newInstance() Construct a new MessageBytes instance |
void | recycle()
Resets the message bytes to an uninitialized (NULL) state. |
void | resetStringValue() Remove the cached string value. |
void | setBytes(byte[] b, int off, int len)
Sets the content to the specified subarray of bytes.
|
void | setCaseSenitive(boolean b) Configure the case sensitivity |
void | setChars(char[] c, int off, int len)
Sets the content to be a char[]
|
void | setEncoding(String enc) Set the encoding. |
static void | setFactory(MessageBytes.MessageBytesFactory mbf) |
void | setInt(int i) Set the buffer to the representation of an int |
void | setLong(long l) Set the buffer to the representation of an long |
void | setString(String s)
Set the content to be a string |
void | setTime(long t, DateFormat df) |
void | setTime(long t) |
boolean | startsWith(String s)
Returns true if the message bytes starts with the specified string. |
boolean | startsWithIgnoreCase(String s, int pos)
Returns true if the message bytes starts with the specified string. |
void | toBytes() Unimplemented yet. |
void | toChars() Convert to char[] and fill the CharChunk.
|
String | toString() Compute the string value |
Deprecated: Use static newInstance() in order to allow future hooks.
Creates a new, uninitialized MessageBytes object.Parameters: s the String to compare
Returns: true if the comparison succeeded, false otherwise
Parameters: s the String to compare
Returns: true if the comparison succeeded, false otherwise
Deprecated: The buffer are general purpose, caching for headers should be done in headers
Parameters: c the character starting The start position
Parameters: b the bytes off the start offset of the bytes len the length of the bytes
Parameters: c the bytes off the start offset of the bytes len the length of the bytes
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.
Deprecated:
Parameters: s the string
Parameters: s the string pos The start position