Java Doc for ByteBuffer.java in  » 6.0-JDK-Modules » j2me » com » sun » cldchi » tools » memoryprofiler » jdwp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » com.sun.cldchi.tools.memoryprofiler.jdwp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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


Field Summary
protected  byte[]bytes
    
 intparseOffset
    

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  voidaddByte(int b)
     Adds byte to the end of the filled part of the buffer.
public  voidaddBytes(byte[] b, int start, int len)
     Adds a number of bytes to the end of the filled part of the buffer.
public  voidaddID(long l, int count)
     Adds an integer value (int, short, long) to the end of the filled part of the buffer.
public  voidaddInt(int b)
     Adds int to the end of the filled part of the buffer.
public  voidaddLong(long l)
     Adds long to the end of the filled part of the buffer.
public  voidaddShort(int b)
     Adds short to the end of the filled part of the buffer.
public  voidaddString(String s)
     Adds String to the end of the filled part of the buffer.
public  voiddeleteBytes(int count)
     Deletes a few bytes from the beginning of the buffer and copies the last part to the beginning of the buffer.
public  intgetByte()
     Tries to read next byte from the buffer.
public  intgetByte(int off)
     Tries to read a single byte from the buffer.
public  longgetID(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  longgetID(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  intgetInt()
     Tries to read next int from the buffer. Value is read is one that is pointed by reading marker.
public  intgetInt(int off)
     Tries to read an int value from the buffer. Value is to read is located at specified index.
public  longgetLong()
     Tries to read next long from the buffer. Value is read is one that is pointed by reading marker.
public  longgetLong(int off)
     Tries to read an long value from the buffer. Value is to read is located at specified index.
public  intgetShort()
     Tries to read next short from the buffer. Value is read is one that is pointed by reading marker.
public  intgetShort(int off)
     Tries to read an short value from the buffer. Value is to read is located at specified index.
public  StringgetString()
     Tries to read next string from the buffer. Value is read is one that is pointed by reading marker.
public  StringgetString(int off)
     Tries to read a string from the buffer. The string is to read is located at specified index.
public  booleanisParsed()
     Checks if reading marker points to the end of filled data of the buffer.
public  intlength()
    
public  voidputByte(int off, int b)
     Stores byte at the specified index in the buffer.
public  voidputBytes(int off, byte[] b, int start, int len)
     Stores a number of bytes at the specified location of the buffer.
public  voidputID(int off, long l, int count)
     Stores an integer value (short, int, long) in the buffer.
public  voidputInt(int off, int b)
     Stores int value in the buffer starting from specified index.
public  voidputLong(int off, long l)
     Stores long value in the buffer starting from specified index.
public  voidputShort(int off, int b)
     Stores short value in the buffer starting from specified index.
public  voidresetBuffer()
     Clears the buffer by setting the size of the filled area to zero.
public  voidresetParser()
     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  voidresetParser(int i)
     Move the reading marker to the specified position.
public  StringtoString(int start)
     Returns string representation of the contents of the buffer from the specified index.
public  StringtoString()
     Returns string representation of the object.

Field Detail
bytes
protected byte[] bytes(Code)
The contents of the buffer



parseOffset
int parseOffset(Code)
The index of the byte that will be read next




Constructor Detail
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




Method Detail
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



Methods inherited from java.lang.Object
public boolean equals(Object obj)(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.