Java Doc for MessageBytes.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » tomcat » util » buf » 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 » Sevlet Container » apache tomcat 6.0.14 » org.apache.tomcat.util.buf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tomcat.util.buf.MessageBytes

MessageBytes
final public class MessageBytes implements Cloneable,Serializable(Code)
This class is used to represent a subarray of bytes in an HTTP message. It represents all request/response elements. The byte/char conversions are delayed and cached. Everything is recyclable. The object can represent a byte[], a char[], or a (sub) String. All operations can be made in case sensitive mode or not.
author:
   dac@eng.sun.com
author:
   James Todd [gonzo@eng.sun.com]
author:
   Costin Manolache

Inner Class :public static class MessageBytesFactory

Field Summary
final public static  intT_BYTES
    
final public static  intT_CHARS
    
final public static  intT_NULL
    
final public static  intT_STR
    

Constructor Summary
public  MessageBytes()
     Creates a new, uninitialized MessageBytes object.

Method Summary
public  voidduplicate(MessageBytes src)
    
public  booleanequals(String s)
     Compares the message bytes to the specified String object.
public  booleanequals(MessageBytes mb)
    
public  booleanequalsIgnoreCase(String s)
     Compares the message bytes to the specified String object.
public  ByteChunkgetByteChunk()
     Returns the byte chunk, representing the byte[] and offset/length.
public  CharChunkgetCharChunk()
     Returns the char chunk, representing the char[] and offset/length.
public  MessageBytesgetClone()
    
public  intgetInt()
    
public  intgetLength()
     Returns the length of the original buffer.
public  longgetLong()
    
public  StringgetString()
     Returns the string value.
public  longgetTime()
    
public  intgetType()
     Return the type of the original content.
public  inthashCode()
    
public  intindexOf(char c)
    
public  intindexOf(String s, int starting)
    
public  intindexOf(String s)
    
public  intindexOf(char c, int starting)
     Returns true if the message bytes starts with the specified string.
public  intindexOfIgnoreCase(String s, int starting)
    
public  booleanisNull()
    
public static  MessageBytesnewInstance()
    
public  voidrecycle()
     Resets the message bytes to an uninitialized (NULL) state.
public  voidresetStringValue()
     Remove the cached string value.
public  voidsetBytes(byte[] b, int off, int len)
     Sets the content to the specified subarray of bytes.
public  voidsetCaseSenitive(boolean b)
    
public  voidsetChars(char[] c, int off, int len)
    
public  voidsetEncoding(String enc)
     Set the encoding.
public static  voidsetFactory(MessageBytesFactory mbf)
    
public  voidsetInt(int i)
    
public  voidsetLong(long l)
    
public  voidsetString(String s)
    
public  voidsetTime(long t, DateFormat df)
    
public  voidsetTime(long t)
    
public  booleanstartsWith(String s)
     Returns true if the message bytes starts with the specified string.
public  booleanstartsWithIgnoreCase(String s, int pos)
     Returns true if the message bytes starts with the specified string.
public  voidtoBytes()
     Unimplemented yet.
public  voidtoChars()
     Convert to char[] and fill the CharChunk.
public  StringtoString()
    

Field Detail
T_BYTES
final public static int T_BYTES(Code)
getType() is T_STR if the the object used to create the MessageBytes was a byte[]



T_CHARS
final public static int T_CHARS(Code)
getType() is T_STR if the the object used to create the MessageBytes was a char[]



T_NULL
final public static int T_NULL(Code)



T_STR
final public static int T_STR(Code)
getType() is T_STR if the the object used to create the MessageBytes was a String




Constructor Detail
MessageBytes
public MessageBytes()(Code)
Creates a new, uninitialized MessageBytes object.




Method Detail
duplicate
public void duplicate(MessageBytes src) throws IOException(Code)
Copy the src into this MessageBytes, allocating more space if needed



equals
public boolean equals(String s)(Code)
Compares the message bytes to the specified String object.
Parameters:
  s - the String to compare true if the comparison succeeded, false otherwise



equals
public boolean equals(MessageBytes mb)(Code)



equalsIgnoreCase
public boolean equalsIgnoreCase(String s)(Code)
Compares the message bytes to the specified String object.
Parameters:
  s - the String to compare true if the comparison succeeded, false otherwise



getByteChunk
public ByteChunk getByteChunk()(Code)
Returns the byte chunk, representing the byte[] and offset/length. Valid only if T_BYTES or after a conversion was made.



getCharChunk
public CharChunk getCharChunk()(Code)
Returns the char chunk, representing the char[] and offset/length. Valid only if T_CHARS or after a conversion was made.



getClone
public MessageBytes getClone()(Code)



getInt
public int getInt()(Code)
Convert the buffer to an int, cache the value



getLength
public int getLength()(Code)
Returns the length of the original buffer. Note that the length in bytes may be different from the length in chars.



getLong
public long getLong()(Code)
Convert the buffer to an long, cache the value



getString
public String getString()(Code)
Returns the string value. Valid only if T_STR or after a conversion was made.



getTime
public long getTime()(Code)



getType
public int getType()(Code)
Return the type of the original content. Can be T_STR, T_BYTES, T_CHARS or T_NULL



hashCode
public int hashCode()(Code)



indexOf
public int indexOf(char c)(Code)



indexOf
public int indexOf(String s, int starting)(Code)



indexOf
public int indexOf(String s)(Code)



indexOf
public int indexOf(char c, int starting)(Code)
Returns true if the message bytes starts with the specified string.
Parameters:
  c - the character
Parameters:
  starting - The start position



indexOfIgnoreCase
public int indexOfIgnoreCase(String s, int starting)(Code)



isNull
public boolean isNull()(Code)



newInstance
public static MessageBytes newInstance()(Code)
Construct a new MessageBytes instance



recycle
public void recycle()(Code)
Resets the message bytes to an uninitialized (NULL) state.



resetStringValue
public void resetStringValue()(Code)
Remove the cached string value. Use it after a conversion on the byte[] or after the encoding is changed XXX Is this needed ?



setBytes
public void setBytes(byte[] b, int off, int len)(Code)
Sets the content to the specified subarray of bytes.
Parameters:
  b - the bytes
Parameters:
  off - the start offset of the bytes
Parameters:
  len - the length of the bytes



setCaseSenitive
public void setCaseSenitive(boolean b)(Code)
Configure the case sensitivity



setChars
public void setChars(char[] c, int off, int len)(Code)
Sets the content to be a char[]
Parameters:
  c - the bytes
Parameters:
  off - the start offset of the bytes
Parameters:
  len - the length of the bytes



setEncoding
public void setEncoding(String enc)(Code)
Set the encoding. If the object was constructed from bytes[]. any previous conversion is reset. If no encoding is set, we'll use 8859-1.



setFactory
public static void setFactory(MessageBytesFactory mbf)(Code)



setInt
public void setInt(int i)(Code)
Set the buffer to the representation of an int



setLong
public void setLong(long l)(Code)
Set the buffer to the representation of an long



setString
public void setString(String s)(Code)
Set the content to be a string



setTime
public void setTime(long t, DateFormat df)(Code)



setTime
public void setTime(long t)(Code)



startsWith
public boolean startsWith(String s)(Code)
Returns true if the message bytes starts with the specified string.
Parameters:
  s - the string



startsWithIgnoreCase
public boolean startsWithIgnoreCase(String s, int pos)(Code)
Returns true if the message bytes starts with the specified string.
Parameters:
  s - the string
Parameters:
  pos - The start position



toBytes
public void toBytes()(Code)
Unimplemented yet. Do a char->byte conversion.



toChars
public void toChars()(Code)
Convert to char[] and fill the CharChunk. XXX Not optimized - it converts to String first.



toString
public String toString()(Code)
Compute the string value



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(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.