All Packages Class Hierarchy This Package Previous Next Index
Class sun.servlet.http.MessageString
java.lang.Object
|
+----sun.servlet.util.Ascii
|
+----sun.servlet.http.MessageBytes
|
+----sun.servlet.http.MessageString
- public class MessageString
- extends MessageBytes
This class is used to represent a string in an HTTP message, and can either
be an actual String or a subarray of bytes.
-
str
- The message String.
-
MessageString()
- Creates a new, uninitialized message string.
-
MessageString(byte[], int, int)
- Creates a new message string with the specified bytes.
-
MessageString(String)
- Creates a new message string with the specified String object.
-
equals(byte[], int, int)
- Compares this message string to the specified subarray of bytes.
-
equals(String)
- Compares this message string to the specified String object.
-
equalsIgnoreCase(byte[], int, int)
- Compares this message string to the specified subarray of bytes.
-
equalsIgnoreCase(String)
- Compares this message string to the specified String object.
-
getBytes(byte[], int)
- Get the bytes of this message string in buf starting at buf_offset.
-
isSet()
- Returns true if the message string is set.
-
length()
- Returns the length of the message string.
-
reset()
- Resets the message string to an uninitialized state.
-
setBytes(byte[], int, int)
- Sets the message string to the specified bytes.
-
setString(String)
- Sets the message string to the specified String.
-
startsWith(String)
- Returns true if the message string starts with the specified string.
-
toDate(HttpDate)
- Returns the message string parsed as a date.
-
toInteger()
- Returns the message string parsed as an unsigned integer.
-
toString()
- Returns the message string as a String object.
-
write(ServletOutputStream)
- Writes the message string to the specified servlet output stream.
str
protected String str
- The message String.
MessageString
public MessageString()
- Creates a new, uninitialized message string.
MessageString
public MessageString(String s)
- Creates a new message string with the specified String object.
- Parameters:
- s - the String
MessageString
public MessageString(byte b[],
int off,
int len)
- Creates a new message string with the specified bytes.
- Parameters:
- b - the bytes
- off - the offset of the bytes
- len - the length of the bytes
reset
public void reset()
- Resets the message string to an uninitialized state.
- Overrides:
- reset in class MessageBytes
setString
public void setString(String s)
- Sets the message string to the specified String.
- Parameters:
- s - the String
setBytes
public void setBytes(byte b[],
int off,
int len)
- Sets the message string to the specified bytes.
- Parameters:
- b - the bytes
- off - the offset of the bytes
- len - the length of the bytes
- Overrides:
- setBytes in class MessageBytes
isSet
public boolean isSet()
- Returns true if the message string is set.
- Overrides:
- isSet in class MessageBytes
getBytes
public int getBytes(byte buf[],
int buf_offset)
- Get the bytes of this message string in buf starting at buf_offset.
- Returns:
- the number of bytes added to buf.
- Overrides:
- getBytes in class MessageBytes
toString
public String toString()
- Returns the message string as a String object.
- Overrides:
- toString in class MessageBytes
toInteger
public int toInteger() throws NumberFormatException
- Returns the message string parsed as an unsigned integer.
- Throws: NumberFormatException
- if the integer format was invalid
- Overrides:
- toInteger in class MessageBytes
toDate
public long toDate(HttpDate d) throws IllegalArgumentException
- Returns the message string parsed as a date.
- Parameters:
- d - the HttpDate object to use for parsing
- Throws: IllegalArgumentException
- if the date format was invalid
- Overrides:
- toDate in class MessageBytes
equals
public boolean equals(String s)
- Compares this message string to the specified String object.
- Parameters:
- s - the String to compare
- Returns:
- true if the comparison succeeded, false otherwise
- Overrides:
- equals in class MessageBytes
equalsIgnoreCase
public boolean equalsIgnoreCase(String s)
- Compares this message string to the specified String object. Case is
ignored in the comparison.
- Parameters:
- s - the String to compare
- Returns:
- true if the comparison succeeded, false otherwise
- Overrides:
- equalsIgnoreCase in class MessageBytes
equals
public boolean equals(byte b[],
int off,
int len)
- Compares this message string to the specified subarray of bytes.
- Parameters:
- b - the bytes to compare
- off - the start offset of the bytes
- len - the length of the bytes
- Returns:
- true if the comparison succeeded, false otherwise
- Overrides:
- equals in class MessageBytes
equalsIgnoreCase
public boolean equalsIgnoreCase(byte b[],
int off,
int len)
- Compares this message string to the specified subarray of bytes.
Case is ignored in the comparison.
- Parameters:
- b - the bytes to compare
- off - the start offset of the bytes
- len - the length of the bytes
- Returns:
- true if the comparison succeeded, false otherwise
- Overrides:
- equalsIgnoreCase in class MessageBytes
startsWith
public boolean startsWith(String s)
- Returns true if the message string starts with the specified string.
- Parameters:
- s - the string
- Overrides:
- startsWith in class MessageBytes
write
public void write(ServletOutputStream out) throws IOException
- Writes the message string to the specified servlet output stream.
- Parameters:
- out - the servlet output stream
- Throws: IOException
- if an I/O error has occurred
length
public int length()
- Returns the length of the message string.
- Overrides:
- length in class MessageBytes
All Packages Class Hierarchy This Package Previous Next Index