HiraokaHyperTools.iTextSharp-LGPL  0.2.5
iTextSharp.text.pdf.ByteBuffer Class Reference
Inheritance diagram for iTextSharp.text.pdf.ByteBuffer:

Public Member Functions

 ByteBuffer ()
 
 ByteBuffer (int size)
 
ByteBuffer Append_i (int b)
 
ByteBuffer Append (byte[] b, int off, int len)
 
ByteBuffer Append (byte[] b)
 
ByteBuffer Append (string str)
 
ByteBuffer Append (char c)
 
ByteBuffer Append (ByteBuffer buf)
 
ByteBuffer Append (int i)
 
ByteBuffer Append (byte b)
 
ByteBuffer AppendHex (byte b)
 
ByteBuffer Append (float i)
 
ByteBuffer Append (double d)
 
void Reset ()
 
byte[] ToByteArray ()
 
override string ToString ()
 
void WriteTo (Stream str)
 
override void Flush ()
 
override int Read (byte[] buffer, int offset, int count)
 
override long Seek (long offset, SeekOrigin origin)
 
override void SetLength (long value)
 
override void Write (byte[] buffer, int offset, int count)
 
override void WriteByte (byte value)
 

Static Public Member Functions

static void SetCacheSize (int size)
 
static void FillCache (int decimals)
 
static string FormatDouble (double d)
 
static string FormatDouble (double d, ByteBuffer buf)
 

Static Public Attributes

const byte ZERO = (byte)'0'
 
static bool HIGH_PRECISION = false
 

Protected Attributes

int count
 
byte[] buf
 

Properties

int Size [get, set]
 
byte[] Buffer [get]
 
override bool CanRead [get]
 
override bool CanSeek [get]
 
override bool CanWrite [get]
 
override long Length [get]
 
override long Position [get, set]
 

Detailed Description

Acts like a StringBuilder but works with byte arrays. floating point is converted to a format suitable to the PDF.

Author
Paulo Soares (psoar.nosp@m.es@c.nosp@m.onsis.nosp@m.te.p.nosp@m.t)

Constructor & Destructor Documentation

◆ ByteBuffer() [1/2]

iTextSharp.text.pdf.ByteBuffer.ByteBuffer ( )

Creates new ByteBuffer with capacity 128

◆ ByteBuffer() [2/2]

iTextSharp.text.pdf.ByteBuffer.ByteBuffer ( int  size)

Creates a byte buffer with a certain capacity.

Parameters
sizethe initial capacity

Member Function Documentation

◆ Append() [1/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( byte  b)

◆ Append() [2/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( byte[]  b)

Appends an array of bytes.

Parameters
bthe array to be appended
Returns
a reference to this ByteBuffer object

◆ Append() [3/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( byte[]  b,
int  off,
int  len 
)

Appends the subarray of the byte array. The buffer will grow by len bytes.

Parameters
bthe array to be appended
offthe offset to the start of the array
lenthe length of bytes to Append
Returns
a reference to this ByteBuffer object

◆ Append() [4/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( ByteBuffer  buf)

Appends another ByteBuffer to this buffer.

Parameters
bufthe ByteBuffer to be appended
Returns
a reference to this ByteBuffer object

◆ Append() [5/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( char  c)

Appends a char to the buffer. The char is converted according to the encoding ISO-8859-1.

Parameters
cthe char to be appended
Returns
a reference to this ByteBuffer object

◆ Append() [6/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( double  d)

Appends a string representation of a double according to the Pdf conventions.

Parameters
dthe double to be appended
Returns
a reference to this ByteBuffer object

◆ Append() [7/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( float  i)

Appends a string representation of a float according to the Pdf conventions.

Parameters
ithe float to be appended
Returns
a reference to this ByteBuffer object

◆ Append() [8/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( int  i)

Appends the string representation of an int.

Parameters
ithe int to be appended
Returns
a reference to this ByteBuffer object

◆ Append() [9/9]

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append ( string  str)

Appends a string to the buffer. The string is converted according to the encoding ISO-8859-1.

Parameters
strthe string to be appended
Returns
a reference to this ByteBuffer object

◆ Append_i()

ByteBuffer iTextSharp.text.pdf.ByteBuffer.Append_i ( int  b)

Appends an int. The size of the array will grow by one.

Parameters
bthe int to be appended
Returns
a reference to this ByteBuffer object

◆ AppendHex()

ByteBuffer iTextSharp.text.pdf.ByteBuffer.AppendHex ( byte  b)

◆ FillCache()

static void iTextSharp.text.pdf.ByteBuffer.FillCache ( int  decimals)
static

You can fill the cache in advance if you want to.

Parameters
decimals

◆ Flush()

override void iTextSharp.text.pdf.ByteBuffer.Flush ( )

◆ FormatDouble() [1/2]

static string iTextSharp.text.pdf.ByteBuffer.FormatDouble ( double  d)
static

Outputs a double into a format suitable for the PDF.

Parameters
da double
Returns
the string representation of the double

◆ FormatDouble() [2/2]

static string iTextSharp.text.pdf.ByteBuffer.FormatDouble ( double  d,
ByteBuffer  buf 
)
static

Outputs a double into a format suitable for the PDF.

Parameters
da double
bufa ByteBuffer
Returns
the String representation of the double if buf is null. If buf is not null, then the double is appended directly to the buffer and this methods returns null.

◆ Read()

override int iTextSharp.text.pdf.ByteBuffer.Read ( byte[]  buffer,
int  offset,
int  count 
)

◆ Reset()

void iTextSharp.text.pdf.ByteBuffer.Reset ( )

Sets the size to zero.

◆ Seek()

override long iTextSharp.text.pdf.ByteBuffer.Seek ( long  offset,
SeekOrigin  origin 
)

◆ SetCacheSize()

static void iTextSharp.text.pdf.ByteBuffer.SetCacheSize ( int  size)
static

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
sizethe size of the cache

◆ SetLength()

override void iTextSharp.text.pdf.ByteBuffer.SetLength ( long  value)

◆ ToByteArray()

byte [] iTextSharp.text.pdf.ByteBuffer.ToByteArray ( )

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.

Returns
the current contents of this output stream, as a byte array.

◆ ToString()

override string iTextSharp.text.pdf.ByteBuffer.ToString ( )

Converts the buffer's contents into a string, translating bytes into characters according to the platform's default character encoding.

Returns
string translated from the buffer's contents.

◆ Write()

override void iTextSharp.text.pdf.ByteBuffer.Write ( byte[]  buffer,
int  offset,
int  count 
)

◆ WriteByte()

override void iTextSharp.text.pdf.ByteBuffer.WriteByte ( byte  value)

◆ WriteTo()

void iTextSharp.text.pdf.ByteBuffer.WriteTo ( Stream  str)

Converts the buffer's contents into a string, translating bytes into characters according to the specified character encoding.

Parameters
enca character-encoding name.
Returns
string translated from the buffer's contents.
Exceptions
UnsupportedEncodingExceptionIf the named encoding is not supported. 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
outthe output stream to which to write the data.
Exceptions
IOExceptionif an I/O error occurs.

Member Data Documentation

◆ buf

byte [] iTextSharp.text.pdf.ByteBuffer.buf
protected

The buffer where the bytes are stored.

◆ count

int iTextSharp.text.pdf.ByteBuffer.count
protected

The count of bytes in the buffer.

◆ HIGH_PRECISION

bool iTextSharp.text.pdf.ByteBuffer.HIGH_PRECISION = false
static

If true always output floating point numbers with 6 decimal digits. If false uses the faster, although less precise, representation.

◆ ZERO

const byte iTextSharp.text.pdf.ByteBuffer.ZERO = (byte)'0'
static

Property Documentation

◆ Buffer

byte [] iTextSharp.text.pdf.ByteBuffer.Buffer
get

◆ CanRead

override bool iTextSharp.text.pdf.ByteBuffer.CanRead
get

◆ CanSeek

override bool iTextSharp.text.pdf.ByteBuffer.CanSeek
get

◆ CanWrite

override bool iTextSharp.text.pdf.ByteBuffer.CanWrite
get

◆ Length

override long iTextSharp.text.pdf.ByteBuffer.Length
get

◆ Position

override long iTextSharp.text.pdf.ByteBuffer.Position
getset

◆ Size

int iTextSharp.text.pdf.ByteBuffer.Size
getset

Returns the current size of the buffer.

Returns
the value of the count field, which is the number of valid bytes in this byte buffer.

The documentation for this class was generated from the following file: