The object can represent a byte[], a char[], or a (sub) String. All operations can be made in case sensitive mode or not.
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private final ByteChunk | |
| private final CharChunk | |
| public static final char[] | |
| private static final MessageBytes. | |
| private boolean | |
| private int | |
| private boolean | |
| private long | |
| private static final long | |
| private static final StringManager | |
| private String | |
| public static final int | T_BYTES
getType() is T_BYTES if the the object used to create the MessageBytes was a byte[]. |
| public static final int | T_CHARS
getType() is T_CHARS if the the object used to create the MessageBytes was a char[]. |
| public static final int | |
| public static final int | T_STR
getType() is T_STR if the the object used to create the MessageBytes was a String. |
| private int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Object | |
| public void | duplicate(MessageBytes
The source src)Copy the src into this MessageBytes, allocating more space if needed. |
| public boolean | |
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public boolean | |
| public boolean | Returns: true if the comparison succeeded, false otherwisethe String to compare s)Compares the message bytes to the specified String object. |
| public ByteChunk | Returns: the byte chunkReturns the byte chunk, representing the byte[] and offset/length. |
| public CharChunk | Returns: the char chunkReturns the char chunk, representing the char[] and offset/length. |
| public Charset | |
| public int | |
| public long | |
| public String | |
| public int | |
| private int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public boolean | |
| public static MessageBytes | |
| public void | |
| public void | setBytes(byte[]
the bytes b, int the start offset of the bytes off, int the length of the bytes len)Sets the content to the specified subarray of bytes. |
| public void | setChars(char[]
the chars c, int the start offset of the chars off, int the length of the chars len)Sets the content to be a char[] |
| public void | |
| public void | |
| public void | |
| public boolean | Returns: true if the message bytes starts with the specified string.the string s, int The start position pos)
|
| public void | |
| private void | |
| public void | |
| public String | |
| public String | Returns: The current value as a StringConvert to String (if not already of the String type) and then return the String value. |
| byteC | back to summary |
|---|---|
| private final ByteChunk byteC | |
| charC | back to summary |
|---|---|
| private final CharChunk charC | |
| EMPTY_CHAR_ARRAY | back to summary |
|---|---|
| public static final char[] EMPTY_CHAR_ARRAY | |
| factory | back to summary |
|---|---|
| private static final MessageBytes. | |
| hasHashCode | back to summary |
|---|---|
| private boolean hasHashCode | |
| hashCode | back to summary |
|---|---|
| private int hashCode | |
| hasLongValue | back to summary |
|---|---|
| private boolean hasLongValue | |
| longValue | back to summary |
|---|---|
| private long longValue | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| sm | back to summary |
|---|---|
| private static final StringManager sm | |
| strValue | back to summary |
|---|---|
| private String strValue | |
| T_BYTES | back to summary |
|---|---|
| public static final int T_BYTES getType() is T_BYTES if the the object used to create the MessageBytes was a byte[]. | |
| T_CHARS | back to summary |
|---|---|
| public static final int T_CHARS getType() is T_CHARS if the the object used to create the MessageBytes was a char[]. | |
| T_NULL | back to summary |
|---|---|
| public static final int T_NULL | |
| T_STR | back to summary |
|---|---|
| public static final int T_STR getType() is T_STR if the the object used to create the MessageBytes was a String. | |
| type | back to summary |
|---|---|
| private int type | |
| MessageBytes | back to summary |
|---|---|
| private MessageBytes() Creates a new, uninitialized MessageBytes object. Use static newInstance() in order to allow future hooks. | |
| clone | back to summary |
|---|---|
| public Object clone() throws CloneNotSupportedException Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| duplicate | back to summary |
|---|---|
| public void duplicate(MessageBytes src) throws IOException Copy the src into this MessageBytes, allocating more space if needed.
| |
| equals | back to summary |
|---|---|
| public boolean equals(String s) Compares the message bytes to the specified String object.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| equals | back to summary |
|---|---|
| public boolean equals(MessageBytes mb) | |
| equalsIgnoreCase | back to summary |
|---|---|
| public boolean equalsIgnoreCase(String s) Compares the message bytes to the specified String object.
| |
| getByteChunk | back to summary |
|---|---|
| public ByteChunk getByteChunk() Returns the byte chunk, representing the byte[] and offset/length. Valid only if T_BYTES or after a conversion was made.
| |
| getCharChunk | back to summary |
|---|---|
| public CharChunk getCharChunk() Returns the char chunk, representing the char[] and offset/length. Valid only if T_CHARS or after a conversion was made.
| |
| getCharset | back to summary |
|---|---|
public Charset getCharset()
| |
| getLength | back to summary |
|---|---|
| public int getLength() Returns the length of the original buffer. Note The length in bytes may be different from the length in chars.
| |
| getLong | back to summary |
|---|---|
| public long getLong() Convert the buffer to a long, cache the value. Used for headers conversion.
| |
| getString | back to summary |
|---|---|
| public String getString() Returns the string value. Valid only if T_STR or after a conversion was made.
| |
| getType | back to summary |
|---|---|
| public int getType() Return the type of the original content. Can be T_STR, T_BYTES, T_CHARS or T_NULL
| |
| hash | back to summary |
|---|---|
| private int hash() | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(String s, int starting) | |
| indexOf | back to summary |
|---|---|
| public int indexOf(String s) | |
| indexOfIgnoreCase | back to summary |
|---|---|
| public int indexOfIgnoreCase(String s, int starting) | |
| isNull | back to summary |
|---|---|
| public boolean isNull() | |
| newInstance | back to summary |
|---|---|
| public static MessageBytes newInstance() Construct a new MessageBytes instance.
| |
| recycle | back to summary |
|---|---|
| public void recycle() Resets the message bytes to an uninitialized (NULL) state. | |
| setBytes | back to summary |
|---|---|
| public void setBytes(byte[] b, int off, int len) Sets the content to the specified subarray of bytes.
| |
| setChars | back to summary |
|---|---|
| public void setChars(char[] c, int off, int len) Sets the content to be a char[]
| |
| setCharset | back to summary |
|---|---|
| public void setCharset(Charset charset) Set the Charset used for string<->byte conversions.
| |
| setLong | back to summary |
|---|---|
| public void setLong(long l) Set the buffer to the representation of a long.
| |
| setString | back to summary |
|---|---|
| public void setString(String s) Set the content to be a string
| |
| startsWithIgnoreCase | back to summary |
|---|---|
public boolean startsWithIgnoreCase(String s, int pos)
| |
| toBytes | back to summary |
|---|---|
| public void toBytes() Convert to bytes and fill the ByteChunk with the converted value. | |
| toBytesSimple | back to summary |
|---|---|
| private void toBytesSimple(char[] chars, int start, int len) Simple conversion of chars to bytes.
| |
| toChars | back to summary |
|---|---|
| public void toChars() Convert to char[] and fill the CharChunk. Note The conversion from bytes is not optimised - it converts to String first. However, Tomcat doesn't call this method to convert from bytes so there is no benefit from optimising that path. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Compute the string value. | |
| toStringType | back to summary |
|---|---|
| public String toStringType() Convert to String (if not already of the String type) and then return the String value.
| |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public MessageBytes |
| MessageBytesFactory | back to summary |
|---|---|
| protected MessageBytesFactory() | |
| newInstance | back to summary |
|---|---|
| public MessageBytes newInstance() | |