public final class MessageBytes
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
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
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
duplicate(MessageBytes src)
Copy the src into this MessageBytes, allocating more space if
needed
|
boolean |
equals(MessageBytes mb) |
boolean |
equals(java.lang.Object obj) |
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 byte chunk, representing the byte[] and offset/length.
|
CharChunk |
getCharChunk()
Returns the char chunk, representing the char[] and offset/length.
|
int |
getLength()
Returns the length of the original buffer.
|
long |
getLong()
Convert the buffer to an long, cache the value
|
java.lang.String |
getString()
Returns the string value.
|
int |
getType()
Return the type of the original content.
|
int |
hashCode() |
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()
Construct a new MessageBytes instance
|
void |
recycle()
Resets the message bytes to an uninitialized (NULL) state.
|
void |
setBytes(byte[] b,
int off,
int len)
Sets the content to the specified subarray of bytes.
|
void |
setChars(char[] c,
int off,
int len)
Sets the content to be a char[]
|
void |
setLong(long l)
Set the buffer to the representation of an long
|
void |
setString(java.lang.String s)
Set the content to be a string
|
boolean |
startsWithIgnoreCase(java.lang.String s,
int pos)
Returns true if the message bytes starts with the specified string.
|
void |
toBytes()
Do a char->byte conversion.
|
void |
toChars()
Convert to char[] and fill the CharChunk.
|
java.lang.String |
toString()
Compute the string value
|
public static final int T_NULL
public static final int T_STR
public static final int T_BYTES
public static final int T_CHARS
public static MessageBytes newInstance()
public boolean isNull()
public void recycle()
public void setBytes(byte[] b,
int off,
int len)
b - the bytesoff - the start offset of the byteslen - the length of the bytespublic void setChars(char[] c,
int off,
int len)
c - the bytesoff - the start offset of the byteslen - the length of the bytespublic void setString(java.lang.String s)
public java.lang.String toString()
toString 在类中 java.lang.Objectpublic 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 comparepublic boolean equalsIgnoreCase(java.lang.String s)
s - the String to comparepublic boolean equals(java.lang.Object obj)
equals 在类中 java.lang.Objectpublic boolean equals(MessageBytes mb)
public boolean startsWithIgnoreCase(java.lang.String s,
int pos)
s - the stringpos - The start positionpublic int hashCode()
hashCode 在类中 java.lang.Objectpublic 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 void duplicate(MessageBytes src) throws java.io.IOException
java.io.IOExceptionpublic void setLong(long l)
public long getLong()
Copyright © 2001-2014 hynnet.com