All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class sun.servlet.http.MessageBytes

java.lang.Object
   |
   +----sun.servlet.util.Ascii
           |
           +----sun.servlet.http.MessageBytes

public class MessageBytes
extends Ascii
This class is used to represent a subarray of bytes in an HTTP message.


Variable Index

 o bytes
The message bytes.
 o length
The length of the bytes.
 o offset
The start offset of the bytes.

Constructor Index

 o MessageBytes()
Creates a new, uninitialized MessageBytes object.
 o MessageBytes(byte[], int, int)
Creates a new MessageBytes object with the specified bytes.

Method Index

 o equals(byte[], int, int)
Compares the message bytes to the specified subarray of bytes.
 o equals(String)
Compares the message bytes to the specified String object.
 o equalsIgnoreCase(byte[], int, int)
Compares the message bytes to the specified subarray of bytes.
 o equalsIgnoreCase(String)
Compares the message bytes to the specified String object.
 o getBytes()
Returns the message bytes.
 o getBytes(byte[], int)
Puts the message bytes in buf starting at buf_offset.
 o getLength()
Returns the length of the bytes.
 o getOffset()
Returns the start offset of the bytes.
 o isSet()
Returns true if the message bytes have been set.
 o length()
Returns the length of the message bytes.
 o reset()
Resets the message bytes to an uninitialized state.
 o setBytes(byte[], int, int)
Sets the message bytes to the specified subarray of bytes.
 o startsWith(String)
Returns true if the message bytes starts with the specified string.
 o toDate(HttpDate)
Returns the message bytes parsed as a date.
 o toInteger()
Returns the message bytes parsed as an unsigned integer.
 o toString()
Returns the message bytes as a String object.
 o write(OutputStream)
Writes the message bytes to the specified output stream.

Variables

 o bytes
 protected byte bytes[]
The message bytes.

 o offset
 protected int offset
The start offset of the bytes.

 o length
 protected int length
The length of the bytes.

Constructors

 o MessageBytes
 public MessageBytes()
Creates a new, uninitialized MessageBytes object.

 o MessageBytes
 public MessageBytes(byte b[],
                     int off,
                     int len)
Creates a new MessageBytes object with the specified bytes.

Parameters:
b - the bytes
off - the start offset of the bytes
len - the length of the bytes

Methods

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

 o setBytes
 public void setBytes(byte b[],
                      int off,
                      int len)
Sets the message bytes to the specified subarray of bytes.

Parameters:
b - the ascii bytes
off - the start offset of the bytes
len - the length of the bytes
 o getBytes
 public byte[] getBytes()
Returns the message bytes.

 o getBytes
 public int getBytes(byte buf[],
                     int buf_offset)
Puts the message bytes in buf starting at buf_offset.

Returns:
the number of bytes added to buf.
 o getOffset
 public int getOffset()
Returns the start offset of the bytes.

 o getLength
 public int getLength()
Returns the length of the bytes.

 o isSet
 public boolean isSet()
Returns true if the message bytes have been set.

 o toString
 public String toString()
Returns the message bytes as a String object.

Overrides:
toString in class Object
 o toInteger
 public int toInteger() throws NumberFormatException
Returns the message bytes parsed as an unsigned integer.

Throws: NumberFormatException
if the integer format was invalid
 o toDate
 public long toDate(HttpDate d) throws IllegalArgumentException
Returns the message bytes parsed as a date.

Parameters:
d - the HttpDate object to use for parsing
Throws: IllegalArgumentException
if the date format was invalid
 o equals
 public boolean equals(String s)
Compares the message bytes to the specified String object.

Parameters:
s - the String to compare
Returns:
true if the comparison succeeded, false otherwise
 o equalsIgnoreCase
 public boolean equalsIgnoreCase(String s)
Compares the message bytes 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
 o equals
 public boolean equals(byte b[],
                       int off,
                       int len)
Compares the message bytes 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
 o equalsIgnoreCase
 public boolean equalsIgnoreCase(byte b[],
                                 int off,
                                 int len)
Compares the message bytes 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
 o startsWith
 public boolean startsWith(String s)
Returns true if the message bytes starts with the specified string.

Parameters:
s - the string
 o write
 public void write(OutputStream out) throws IOException
Writes the message bytes to the specified output stream.

Parameters:
out - the output stream
Throws: IOException
if an I/O error has occurred
 o length
 public int length()
Returns the length of the message bytes.


All Packages  Class Hierarchy  This Package  Previous  Next  Index