Java Doc for ByteBuffer.java in  » PDF » pdf-itext » com » lowagie » text » pdf » 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 » PDF » pdf itext » com.lowagie.text.pdf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.io.OutputStream
      com.lowagie.text.pdf.ByteBuffer

ByteBuffer
public class ByteBuffer extends OutputStream (Code)
Acts like a StringBuffer but works with byte arrays. Floating point is converted to a format suitable to the PDF.
author:
   Paulo Soares (psoares@consiste.pt)


Field Summary
public static  booleanHIGH_PRECISION
     If true always output floating point numbers with 6 decimal digits.
final public static  byteZERO
    
protected  bytebuf
     The buffer where the bytes are stored.
protected  intcount
     The count of bytes in the buffer.

Constructor Summary
public  ByteBuffer()
    
public  ByteBuffer(int size)
     Creates a byte buffer with a certain capacity.

Method Summary
public  ByteBufferappend(byte b, int off, int len)
     Appends the subarray of the byte array.
public  ByteBufferappend(byte b)
     Appends an array of bytes.
public  ByteBufferappend(String str)
     Appends a String to the buffer.
public  ByteBufferappend(char c)
     Appends a char to the buffer.
public  ByteBufferappend(ByteBuffer buf)
     Appends another ByteBuffer to this buffer.
public  ByteBufferappend(int i)
     Appends the string representation of an int.
public  ByteBufferappend(byte b)
    
public  ByteBufferappend(float i)
     Appends a string representation of a float according to the Pdf conventions.
public  ByteBufferappend(double d)
     Appends a string representation of a double according to the Pdf conventions.
public  ByteBufferappendHex(byte b)
    
public  ByteBufferappend_i(int b)
     Appends an int.
public static  voidfillCache(int decimals)
     You can fill the cache in advance if you want to.
public static  StringformatDouble(double d)
     Outputs a double into a format suitable for the PDF.
public static  StringformatDouble(double d, ByteBuffer buf)
     Outputs a double into a format suitable for the PDF.
Parameters:
  d - a double
Parameters:
  buf - a ByteBuffer the String representation of the double ifbuf is null.
public  byte[]getBuffer()
    
public  voidreset()
     Sets the size to zero.
public static  voidsetCacheSize(int size)
     Sets the cache size.
public  voidsetSize(int size)
    
public  intsize()
     Returns the current size of the buffer.
public  byte[]toByteArray()
     Creates a newly allocated byte array.
public  StringtoString()
     Converts the buffer's contents into a string, translating bytes into characters according to the platform's default character encoding.
public  StringtoString(String enc)
     Converts the buffer's contents into a string, translating bytes into characters according to the specified character encoding.
Parameters:
  enc - a character-encoding name.
public  voidwrite(int b)
    
public  voidwrite(byte[] b, int off, int len)
    
public  voidwriteTo(OutputStream out)
     Writes the complete contents of this byte buffer output to the specified output stream argument, as if by calling the output stream's write method using out.write(buf, 0, count).

Field Detail
HIGH_PRECISION
public static boolean HIGH_PRECISION(Code)
If true always output floating point numbers with 6 decimal digits. If false uses the faster, although less precise, representation.



ZERO
final public static byte ZERO(Code)



buf
protected byte buf(Code)
The buffer where the bytes are stored.



count
protected int count(Code)
The count of bytes in the buffer.




Constructor Detail
ByteBuffer
public ByteBuffer()(Code)
Creates new ByteBuffer with capacity 128



ByteBuffer
public ByteBuffer(int size)(Code)
Creates a byte buffer with a certain capacity.
Parameters:
  size - the initial capacity




Method Detail
append
public ByteBuffer append(byte b, int off, int len)(Code)
Appends the subarray of the byte array. The buffer will grow by len bytes.
Parameters:
  b - the array to be appended
Parameters:
  off - the offset to the start of the array
Parameters:
  len - the length of bytes to append a reference to this ByteBuffer object



append
public ByteBuffer append(byte b)(Code)
Appends an array of bytes.
Parameters:
  b - the array to be appended a reference to this ByteBuffer object



append
public ByteBuffer append(String str)(Code)
Appends a String to the buffer. The String is converted according to the encoding ISO-8859-1.
Parameters:
  str - the String to be appended a reference to this ByteBuffer object



append
public ByteBuffer append(char c)(Code)
Appends a char to the buffer. The char is converted according to the encoding ISO-8859-1.
Parameters:
  c - the char to be appended a reference to this ByteBuffer object



append
public ByteBuffer append(ByteBuffer buf)(Code)
Appends another ByteBuffer to this buffer.
Parameters:
  buf - the ByteBuffer to be appended a reference to this ByteBuffer object



append
public ByteBuffer append(int i)(Code)
Appends the string representation of an int.
Parameters:
  i - the int to be appended a reference to this ByteBuffer object



append
public ByteBuffer append(byte b)(Code)



append
public ByteBuffer append(float i)(Code)
Appends a string representation of a float according to the Pdf conventions.
Parameters:
  i - the float to be appended a reference to this ByteBuffer object



append
public ByteBuffer append(double d)(Code)
Appends a string representation of a double according to the Pdf conventions.
Parameters:
  d - the double to be appended a reference to this ByteBuffer object



appendHex
public ByteBuffer appendHex(byte b)(Code)



append_i
public ByteBuffer append_i(int b)(Code)
Appends an int. The size of the array will grow by one.
Parameters:
  b - the int to be appended a reference to this ByteBuffer object



fillCache
public static void fillCache(int decimals)(Code)
You can fill the cache in advance if you want to.
Parameters:
  decimals -



formatDouble
public static String formatDouble(double d)(Code)
Outputs a double into a format suitable for the PDF.
Parameters:
  d - a double the String representation of the double



formatDouble
public static String formatDouble(double d, ByteBuffer buf)(Code)
Outputs a double into a format suitable for the PDF.
Parameters:
  d - a double
Parameters:
  buf - a ByteBuffer the String representation of the double ifbuf is null. If buf is not null,then the double is appended directly to the buffer and this methods returns null.



getBuffer
public byte[] getBuffer()(Code)



reset
public void reset()(Code)
Sets the size to zero.



setCacheSize
public static void setCacheSize(int size)(Code)
Sets the cache size.

This can only be used to increment the size. If the size that is passed through is smaller than the current size, nothing happens.
Parameters:
  size - the size of the cache




setSize
public void setSize(int size)(Code)



size
public int size()(Code)
Returns the current size of the buffer. the value of the count field, which is the number of valid bytes in this byte buffer.



toByteArray
public byte[] toByteArray()(Code)
Creates a newly allocated byte array. Its size is the current size of this output stream and the valid contents of the buffer have been copied into it. the current contents of this output stream, as a byte array.



toString
public String toString()(Code)
Converts the buffer's contents into a string, translating bytes into characters according to the platform's default character encoding. String translated from the buffer's contents.



toString
public String toString(String enc) throws UnsupportedEncodingException(Code)
Converts the buffer's contents into a string, translating bytes into characters according to the specified character encoding.
Parameters:
  enc - a character-encoding name. String translated from the buffer's contents.
throws:
  UnsupportedEncodingException - If the named encoding is not supported.



write
public void write(int b) throws IOException(Code)



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



writeTo
public void writeTo(OutputStream out) throws IOException(Code)
Writes the complete contents of this byte buffer output to the specified output stream argument, as if by calling the output stream's write method using out.write(buf, 0, count).
Parameters:
  out - the output stream to which to write the data.
exception:
  IOException - if an I/O error occurs.



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.