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.


Variable Index

 o str
The message String.

Constructor Index

 o MessageString()
Creates a new, uninitialized message string.
 o MessageString(byte[], int, int)
Creates a new message string with the specified bytes.
 o MessageString(String)
Creates a new message string with the specified String object.

Method Index

 o equals(byte[], int, int)
Compares this message string to the specified subarray of bytes.
 o equals(String)
Compares this message string to the specified String object.
 o equalsIgnoreCase(byte[], int, int)
Compares this message string to the specified subarray of bytes.
 o equalsIgnoreCase(String)
Compares this message string to the specified String object.
 o isSet()
Returns true if the message string is set.
 o length()
Returns the length of the message string.
 o reset()
Resets the message string to an uninitialized state.
 o setBytes(byte[], int, int)
Sets the message string to the specified bytes.
 o setString(String)
Sets the message string to the specified String.
 o startsWith(String)
Returns true if the message string starts with the specified string.
 o toDate(HttpDate)
Returns the message string parsed as a date.
 o toInteger()
Returns the message string parsed as an unsigned integer.
 o toString()
Returns the message string as a String object.
 o write(ServletOutputStream)
Writes the message string to the specified servlet output stream.

Variables

 o str
  protected String str
The message String.

Constructors

 o MessageString
  public MessageString()
Creates a new, uninitialized message string.

 o MessageString
  public MessageString(String s)
Creates a new message string with the specified String object.

Parameters:
s - the String
 o 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

Methods

 o reset
  public void reset()
Resets the message string to an uninitialized state.

Overrides:
reset in class MessageBytes
 o setString
  public void setString(String s)
Sets the message string to the specified String.

Parameters:
s - the String
 o 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
 o isSet
  public boolean isSet()
Returns true if the message string is set.

Overrides:
isSet in class MessageBytes
 o toString
  public String toString()
Returns the message string as a String object.

Overrides:
toString in class MessageBytes
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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