| java.lang.Object com.sun.cldchi.tools.memoryprofiler.jdwp.ByteBuffer
All known Subclasses: com.sun.cldchi.tools.memoryprofiler.jdwp.Packet,
ByteBuffer | class ByteBuffer (Code) | | This class encapsulates dynamic linear byte array that is handled
as stream. This class is a superclass for Packet that
encapsulates JDWP packet. ByteBuffer class contains
all the generic (not JDWP specific) methods to work with JDWP packet-kind
structures.
See Also: jdwp.Packet See Also: jdwp.Command See Also: jdwp.Reply |
Constructor Summary | |
public | ByteBuffer() Constructs a new ByteBuffer object with default
initial size and delta. | public | ByteBuffer(int InitialSize, int Delta) Constructs a new ByteBuffer object with specified
initial size and delta. |
Method Summary | |
public void | addByte(int b) Adds byte to the end of the filled part of the buffer. | public void | addBytes(byte[] b, int start, int len) Adds a number of bytes to the end of the filled part of the buffer. | public void | addID(long l, int count) Adds an integer value (int, short, long)
to the end of the filled part of the buffer. | public void | addInt(int b) Adds int to the end of the filled part of the buffer. | public void | addLong(long l) Adds long to the end of the filled part of the buffer. | public void | addShort(int b) Adds short to the end of the filled part of the buffer. | public void | addString(String s) Adds String to the end of the filled part of the buffer. | public void | deleteBytes(int count) Deletes a few bytes from the beginning of the buffer and copies the
last part to the beginning of the buffer. | public int | getByte() Tries to read next byte from the buffer. | public int | getByte(int off) Tries to read a single byte from the buffer. | public long | getID(int count) Tries to read next integer value (short, int, long) from the buffer.
Value is read is one
that is pointed by reading marker. | public long | getID(int off, int count) Tries to read an integer value (short, int, long) from the buffer.
Value is to read is located at specified index. | public int | getInt() Tries to read next int from the buffer.
Value is read is one
that is pointed by reading marker. | public int | getInt(int off) Tries to read an int value from the buffer.
Value is to read is located at specified index. | public long | getLong() Tries to read next long from the buffer.
Value is read is one
that is pointed by reading marker. | public long | getLong(int off) Tries to read an long value from the buffer.
Value is to read is located at specified index. | public int | getShort() Tries to read next short from the buffer.
Value is read is one
that is pointed by reading marker. | public int | getShort(int off) Tries to read an short value from the buffer.
Value is to read is located at specified index. | public String | getString() Tries to read next string from the buffer.
Value is read is one
that is pointed by reading marker. | public String | getString(int off) Tries to read a string from the buffer.
The string is to read is located at specified index. | public boolean | isParsed() Checks if reading marker points to the end of filled data of the
buffer. | public int | length() | public void | putByte(int off, int b) Stores byte at the specified index in the buffer. | public void | putBytes(int off, byte[] b, int start, int len) Stores a number of bytes at the specified location of the buffer. | public void | putID(int off, long l, int count) Stores an integer value (short, int, long) in the buffer. | public void | putInt(int off, int b) Stores int value in the buffer starting from specified
index. | public void | putLong(int off, long l) Stores long value in the buffer starting from specified
index. | public void | putShort(int off, int b) Stores short value in the buffer starting from specified
index. | public void | resetBuffer() Clears the buffer by setting the size of the filled area to zero. | public void | resetParser() Moves the reading marker to the beginning of the buffer.
Typically the process of reading data from the buffer is
organized as follows: at first move the reading marker to the
some start position (for example, in the beginning of the buffer)
and then consequently read the data using get methods (for example,
getInt() ). | public void | resetParser(int i) Move the reading marker to the specified position. | public String | toString(int start) Returns string representation of the contents of the buffer from
the specified index. | public String | toString() Returns string representation of the object. |
bytes | protected byte[] bytes(Code) | | The contents of the buffer
|
parseOffset | int parseOffset(Code) | | The index of the byte that will be read next
|
ByteBuffer | public ByteBuffer()(Code) | | Constructs a new ByteBuffer object with default
initial size and delta.
See Also: ByteBuffer.Delta |
ByteBuffer | public ByteBuffer(int InitialSize, int Delta)(Code) | | Constructs a new ByteBuffer object with specified
initial size and delta.
Parameters: InitialSize - initial size of the buffer Parameters: Delta - the size that buffer increases if necessary See Also: ByteBuffer.Delta |
addByte | public void addByte(int b)(Code) | | Adds byte to the end of the filled part of the buffer.
If there is no place to
store this data the buffer is automatically increased.
Parameters: b - a byte to be appended |
addBytes | public void addBytes(byte[] b, int start, int len)(Code) | | Adds a number of bytes to the end of the filled part of the buffer.
If there is no place to
store this data the buffer is automatically increased.
Parameters: b - a byte array the data should be appended from Parameters: start - the index in the byte array of the first byte thatshould be appended Parameters: len - a number of bytes that should be added to the buffer |
addID | public void addID(long l, int count)(Code) | | Adds an integer value (int, short, long)
to the end of the filled part of the buffer.
If there is no place to
store this data the buffer is automatically increased.
The value is stored in the little endian format.
Parameters: l - a value to be appended Parameters: count - a size of the value in bytes (2 for short ,4 for int , 8 for long ) |
addInt | public void addInt(int b)(Code) | | Adds int to the end of the filled part of the buffer.
If there is no place to
store this data the buffer is automatically increased.
The value is stored in little endian format.
Parameters: b - a value to be appended |
addLong | public void addLong(long l)(Code) | | Adds long to the end of the filled part of the buffer.
If there is no place to
store this data the buffer is automatically increased.
The value is stored in little endian format.
Parameters: b - a value to be appended |
addShort | public void addShort(int b)(Code) | | Adds short to the end of the filled part of the buffer.
If there is no place to
store this data the buffer is automatically increased.
The value is stored in little endian format.
Parameters: b - a value to be appended |
addString | public void addString(String s)(Code) | | Adds String to the end of the filled part of the buffer.
If there is no place to
store this data the buffer is automatically increased.
The value is stored in UTF-8 format.
Parameters: s - a string to be appended |
deleteBytes | public void deleteBytes(int count)(Code) | | Deletes a few bytes from the beginning of the buffer and copies the
last part to the beginning of the buffer.
Parameters: count - a number of bytes to be deleted from the head of the buffer |
getByte | public int getByte() throws BoundException(Code) | | Tries to read next byte from the buffer. Byte is to read is one
that is pointed by reading marker. After completing the operation
the reading marker is incremented.
current byte from the buffer throws: BoundException - if byte to be read is outside the filled area |
getByte | public int getByte(int off) throws BoundException(Code) | | Tries to read a single byte from the buffer. Byte is to read is
located at specified index.
Parameters: off - the index of the buffer where the required byte is located a required byte from the buffer throws: BoundException - if byte to be read is outside the filled area |
getID | public long getID(int count) throws BoundException(Code) | | Tries to read next integer value (short, int, long) from the buffer.
Value is read is one
that is pointed by reading marker. After completing the operation
the reading marker is incremented. The value is stored in little endian
format.
Parameters: count - a size in bytes of integer value (2 for short ,4 for int , 8 for long ) current integer value from the buffer throws: BoundException - if value to be read is outside the filled area |
getID | public long getID(int off, int count) throws BoundException(Code) | | Tries to read an integer value (short, int, long) from the buffer.
Value is to read is located at specified index. The value is stored in
little endian format.
Parameters: off - the index of the buffer where the required value is located Parameters: count - a size in bytes of integer value (2 for short ,4 for int , 8 for long ) a required value from the buffer throws: BoundException - if value to be read is outside the filled area |
getInt | public int getInt() throws BoundException(Code) | | Tries to read next int from the buffer.
Value is read is one
that is pointed by reading marker. After completing the operation
the reading marker is incremented. The value is stored in little endian
format.
current int value from the buffer throws: BoundException - if value to be read is outside the filled area |
getInt | public int getInt(int off) throws BoundException(Code) | | Tries to read an int value from the buffer.
Value is to read is located at specified index. The value is stored in
little endian format.
Parameters: off - the index of the buffer where the required value is located a required value from the buffer throws: BoundException - if value to be read is outside the filled area |
getLong | public long getLong() throws BoundException(Code) | | Tries to read next long from the buffer.
Value is read is one
that is pointed by reading marker. After completing the operation
the reading marker is incremented. The value is stored in little endian
format.
current long value from the buffer throws: BoundException - if value to be read is outside the filled area |
getLong | public long getLong(int off) throws BoundException(Code) | | Tries to read an long value from the buffer.
Value is to read is located at specified index. The value is stored in
little endian format.
Parameters: off - the index of the buffer where the required value is located a required value from the buffer throws: BoundException - if value to be read is outside the filled area |
getShort | public int getShort() throws BoundException(Code) | | Tries to read next short from the buffer.
Value is read is one
that is pointed by reading marker. After completing the operation
the reading marker is incremented. The value is stored in little endian
format.
current short value from the buffer throws: BoundException - if value to be read is outside the filled area |
getShort | public int getShort(int off) throws BoundException(Code) | | Tries to read an short value from the buffer.
Value is to read is located at specified index. The value is stored in
little endian format.
Parameters: off - the index of the buffer where the required value is located a required value from the buffer throws: BoundException - if value to be read is outside the filled area |
getString | public String getString() throws BoundException(Code) | | Tries to read next string from the buffer.
Value is read is one
that is pointed by reading marker. After completing the operation
the reading marker is incremented. The value is stored in UTF-8
format.
current UTF-8 string from the buffer throws: BoundException - if value to be read is outside the filled area |
getString | public String getString(int off) throws BoundException(Code) | | Tries to read a string from the buffer.
The string is to read is located at specified index. The value is stored
in UTF-8 format.
Parameters: off - the index of the buffer where the required string is located a required string from the buffer throws: BoundException - if string to be read is outside the filled area |
isParsed | public boolean isParsed()(Code) | | Checks if reading marker points to the end of filled data of the
buffer. This method is analogue of eof method for the
files.
true if reading marker points to the end offilled data, false otherwise |
length | public int length()(Code) | | Returns length of the filled part of the buffer
length of the filled part of the buffer |
putByte | public void putByte(int off, int b) throws BoundException(Code) | | Stores byte at the specified index in the buffer. If specified index
is outside the filled area of the buffer BoundException
is raised.
Parameters: off - index where byte should be placed Parameters: b - byte that should be placed throws: BoundException - if specified index is outside the filled area ofthe buffer |
putBytes | public void putBytes(int off, byte[] b, int start, int len) throws BoundException(Code) | | Stores a number of bytes at the specified location of the buffer. If
at least one byte is to be stored outside the already filled area of the
buffer BoundException is raised.
Parameters: off - index in the buffer where the first byte should be stored Parameters: b - array of bytes whose values should be stored in the buffer Parameters: start - the first index in the array of bytes that should be stored Parameters: len - the number of bytes that should be stored in the buffer throws: BoundException - if at least one byte should be stored outside thealready filled area of the buffer |
putID | public void putID(int off, long l, int count) throws BoundException(Code) | | Stores an integer value (short, int, long) in the buffer. The value is
stored in Java (little endian) format. If at least one byte of the value
is to be placed outside the alrady filled area of the buffer
BoundException is raised
Parameters: off - index where the first byte of the value should be stored Parameters: l - a value that should be stored Parameters: count - length of the value (2 for short, 4 for int, 8 for long) throws: BoundException - if at least one byte of the value should bestored outside the already filled area of the buffer |
putInt | public void putInt(int off, int b) throws BoundException(Code) | | Stores int value in the buffer starting from specified
index. The value is stored in little endian format.
If at least one byte of the value
is to be placed outside the alrady filled area of the buffer
BoundException is raised.
Parameters: off - index where the first byte of the value should be stored Parameters: b - the value that should be stored throws: BoundException - if at least one byte of the value should bestored outside the already filled area of the buffer |
putLong | public void putLong(int off, long l) throws BoundException(Code) | | Stores long value in the buffer starting from specified
index. The value is stored in little endian format.
If at least one byte of the value
is to be placed outside the alrady filled area of the buffer
BoundException is raised.
Parameters: off - index where the first byte of the value should be stored Parameters: b - the value that should be stored throws: BoundException - if at least one byte of the value should bestored outside the already filled area of the buffer |
putShort | public void putShort(int off, int b) throws BoundException(Code) | | Stores short value in the buffer starting from specified
index. The value is stored in little endian format.
If at least one byte of the value
is to be placed outside the alrady filled area of the buffer
BoundException is raised.
Parameters: off - index where the first byte of the value should be stored Parameters: b - the value that should be stored throws: BoundException - if at least one byte of the value should bestored outside the already filled area of the buffer |
resetBuffer | public void resetBuffer()(Code) | | Clears the buffer by setting the size of the filled area to zero.
The reading marker's position is not affected by this method so if
the reading marker was not positioned to the beginning of the buffer
it'll become to be in invalid position.
|
resetParser | public void resetParser()(Code) | | Moves the reading marker to the beginning of the buffer.
Typically the process of reading data from the buffer is
organized as follows: at first move the reading marker to the
some start position (for example, in the beginning of the buffer)
and then consequently read the data using get methods (for example,
getInt() ). So the process of reading data from the byte
buffer is looks like reading data from generic stream (for example,
from file).
|
resetParser | public void resetParser(int i)(Code) | | Move the reading marker to the specified position.
Parameters: i - index of the buffer where reading marker should point |
toString | public String toString(int start)(Code) | | Returns string representation of the contents of the buffer from
the specified index. This method is invoked by KJDB when JDWP reply
packet is not received (usually it's a fatal error)and this information
is useful for localizing the problem.
Parameters: start - the first index that should be printed string representation of a part of the byte buffer See Also: jdwp.BackEndTest.printReplies |
toString | public String toString()(Code) | | Returns string representation of the object. Currently this method is
not used by KJDB but it may be useful for debugging purposes.
string representation of the object |
|
|