Java Doc for ByteArrayBuffer.java in  » 6.0-JDK-Modules » jax-ws-runtime » com » sun » xml » ws » util » 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 » jax ws runtime » com.sun.xml.ws.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.io.OutputStream
      com.sun.xml.ws.util.ByteArrayBuffer

ByteArrayBuffer
public class ByteArrayBuffer extends OutputStream (Code)
Read/write buffer that stores a sequence of bytes.

It works in a way similar to ByteArrayOutputStream but this class works better in the following ways:

  1. no synchronization
  2. offers a ByteArrayBuffer.newInputStream() that creates a new InputStream that won't cause buffer reallocation.
  3. less parameter correctness checking
  4. offers a ByteArrayBuffer.write(InputStream) method that reads the entirety of the given InputStream without using a temporary buffer.

author:
   Kohsuke Kawaguchi


Field Summary
protected  byte[]buf
     The buffer where data is stored.

Constructor Summary
public  ByteArrayBuffer()
     Creates a new byte array output stream.
public  ByteArrayBuffer(int size)
     Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
public  ByteArrayBuffer(byte[] data)
    

Method Summary
public  voidclose()
    
final public  byte[]getRawData()
     Gets the underlying buffer that this ByteArrayBuffer uses.
final public  InputStreamnewInputStream()
     Creates a new InputStream that reads from this buffer.
final public  InputStreamnewInputStream(int start, int length)
     Creates a new InputStream that reads a part of this bfufer.
final public  voidreset()
    
final public  intsize()
    
final public  byte[]toByteArray()
     Gets the copy of exact-size byte[] that represents the written data.
public  StringtoString()
     Decodes the contents of this buffer by the default encoding and returns it as a string.
final public  voidwrite(InputStream in)
     Reads all the data of the given InputStream and appends them into this buffer.
final public  voidwrite(int b)
    
final public  voidwrite(byte b, int off, int len)
    
final public  voidwriteTo(OutputStream out)
    

Field Detail
buf
protected byte[] buf(Code)
The buffer where data is stored.




Constructor Detail
ByteArrayBuffer
public ByteArrayBuffer()(Code)
Creates a new byte array output stream. The buffer capacity is initially 32 bytes, though its size increases if necessary.



ByteArrayBuffer
public ByteArrayBuffer(int size)(Code)
Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
Parameters:
  size - the initial size.
throws:
  IllegalArgumentException - if size is negative.



ByteArrayBuffer
public ByteArrayBuffer(byte[] data)(Code)




Method Detail
close
public void close() throws IOException(Code)



getRawData
final public byte[] getRawData()(Code)
Gets the underlying buffer that this ByteArrayBuffer uses. It's never small than its ByteArrayBuffer.size() . Use with caution.



newInputStream
final public InputStream newInputStream()(Code)
Creates a new InputStream that reads from this buffer.



newInputStream
final public InputStream newInputStream(int start, int length)(Code)
Creates a new InputStream that reads a part of this bfufer.



reset
final public void reset()(Code)



size
final public int size()(Code)



toByteArray
final public byte[] toByteArray()(Code)
Gets the copy of exact-size byte[] that represents the written data.

Since this method needs to allocate a new byte[], this method will be costly.




toString
public String toString()(Code)
Decodes the contents of this buffer by the default encoding and returns it as a string.

Meant to aid debugging, but no more.




write
final public void write(InputStream in) throws IOException(Code)
Reads all the data of the given InputStream and appends them into this buffer.
throws:
  IOException - if the read operation fails with an IOException.



write
final public void write(int b)(Code)



write
final public void write(byte b, int off, int len)(Code)



writeTo
final public void writeTo(OutputStream out) throws IOException(Code)



Methods inherited from java.io.OutputStream
public void close() throws IOException(Code)(Java Doc)
public void flush() throws IOException(Code)(Java Doc)
abstract public void write(int b) throws IOException(Code)(Java Doc)
public void write(byte b) throws IOException(Code)(Java Doc)
public void write(byte b, int off, int len) throws IOException(Code)(Java Doc)

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.