# org.pdfclown.bytes.IBuffer Interface Reference

Buffer.Its pivotal concept is the array index. More...

Inheritance diagram for org.pdfclown.bytes.IBuffer:

List of all members.

## Public Member Functions
IBuffer | Append (System.IO.Stream data)
| Appends a stream to the buffer.
IBuffer | Append (IInputStream data)
| Appends an IInputStream to the buffer.
IBuffer | Append (string data)
| Appends a string to the buffer.
IBuffer | Append (byte[] data, int offset, int length)
| Appends a byte range to the buffer.
IBuffer | Append (byte[] data)
| Appends a byte array to the buffer.
IBuffer | Append (byte data)
| Appends a byte to the buffer.
IBuffer | Clone ()
| Gets a clone of the buffer.
void | Decode (Filter filter, PdfDictionary parameters)
| Applies the specified filter to decode the buffer.
void | Delete (int index, int length)
| Deletes a byte chunk from the buffer.
byte[] | Encode (Filter filter, PdfDictionary parameters)
| Applies the specified filter to encode the buffer.
int | GetByte (int index)
| Gets the byte at a specified location.
byte[] | GetByteArray (int index, int length)
| Gets the byte range beginning at a specified location.
int | GetHashCode ()
| Gets the hash representation of the sequence.
string | GetString (int index, int length)
| Gets the string beginning at a specified location.
void | Insert (int index, IInputStream data)
| Inserts an IInputStream into the buffer.
void | Insert (int index, string data)
| Inserts a string into the buffer.
void | Insert (int index, byte[] data, int offset, int length)
| Inserts a byte range into the buffer.
void | Insert (int index, byte[] data)
| Inserts a byte array into the buffer.
void | Read (byte[] data, int offset, int length)
| Reads a sequence of bytes.
void | Read (byte[] data)
| Reads a sequence of bytes.
int | ReadByte ()
| Reads a byte.
int | ReadInt (int length)
| Reads a variable-length integer.
int | ReadInt ()
| Reads an integer.
string | ReadLine ()
| Reads the next line of text.
short | ReadShort ()
| Reads a short integer.
sbyte | ReadSignedByte ()
| Reads a signed byte integer.
string | ReadString (int length)
| Reads a string.
ushort | ReadUnsignedShort ()
| Reads an unsigned short integer.
void | Replace (int index, IInputStream data)
| Replaces the buffer contents with an IInputStream.
void | Replace (int index, string data)
| Replaces the buffer contents with a string.
void | Replace (int index, byte[] data, int offset, int length)
| Replaces the buffer contents with a byte range.
void | Replace (int index, byte[] data)
| Replaces the buffer contents with a byte array.
void | Seek (long position)
| Sets the pointer absolute position.
void | SetLength (int value)
| Sets the used buffer size.
void | Skip (long offset)
| Sets the pointer relative position.
byte[] | ToByteArray ()
| Gets the buffer data copied to a newly-allocated byte array.
void | Write (IInputStream data)
| Writes an IInputStream into the stream.
void | Write (string data)
| Writes a string into the stream.
void | Write (byte[] data, int offset, int length)
| Writes a byte range into the stream.
void | Write (byte[] data)
| Writes a byte array into the stream.
void | WriteTo (IOutputStream stream)
| Writes the buffer data to a stream.
## Properties
ByteOrderEnum | ByteOrder`[get, set]`
| Gets/Sets the byte order.
int | Capacity`[get]`
| Gets the allocated buffer size.
bool | Dirty`[get, set]`
| Gets/Sets whether this buffer has changed.
long | Length`[get]`
| Gets the length of the stream.
long | Position`[get, set]`
| Gets/Sets the pointer position.
## Events
EventHandler | OnChange
| Notifies the dirtiness of the observed buffer.

##

Buffer.

Its pivotal concept is the array index.

Returns:
  This buffer.

## Member Function Documentation

IBuffer org.pdfclown.bytes.IBuffer.Append | ( | System.IO.Stream | data | ) |

Appends a stream to the buffer.

Parameters:

  | data | Source data to copy.

Returns:
  This buffer.

Implemented in org.pdfclown.bytes.Buffer.

IBuffer org.pdfclown.bytes.IBuffer.Append | ( | IInputStream | data | ) |

Appends an IInputStream to the buffer.

Parameters:

  | data | Source data to copy.

Returns:
  This buffer.

Implemented in org.pdfclown.bytes.Buffer.

IBuffer org.pdfclown.bytes.IBuffer.Append | ( | string | data | ) |

Appends a string to the buffer.

Parameters:

  | data | String to copy.

Returns:
  This buffer.

Implemented in org.pdfclown.bytes.Buffer.

IBuffer org.pdfclown.bytes.IBuffer.Append | ( | byte[] | data,
|  | int | offset,
|  | int | length |
| ) |  |  |

Appends a byte range to the buffer.

Parameters:

  | data | Byte array from which the byte range has to be copied.
  | offset | Location in the byte array at which copying begins.
  | length | Number of bytes to copy.

Returns:
  This buffer.

Implemented in org.pdfclown.bytes.Buffer.

IBuffer org.pdfclown.bytes.IBuffer.Append | ( | byte[] | data | ) |

Appends a byte array to the buffer.

Parameters:

  | data | Byte array to copy.

Returns:
  This buffer.

Implemented in org.pdfclown.bytes.Buffer.

IBuffer org.pdfclown.bytes.IBuffer.Append | ( | byte | data | ) |

Appends a byte to the buffer.

Parameters:

  | data | Byte to copy.

Returns:
  This buffer.

Implemented in org.pdfclown.bytes.Buffer.

Referenced by org.pdfclown.bytes.Buffer.Clone(), and org.pdfclown.documents.Page.ToXObject().

IBuffer org.pdfclown.bytes.IBuffer.Clone | ( |  | ) |

Gets a clone of the buffer.

Returns:
  Deep copy of the buffer.

Implemented in org.pdfclown.bytes.Buffer.

Referenced by org.pdfclown.objects.Cloner.Visit().

void org.pdfclown.bytes.IBuffer.Decode | ( | Filter | filter,
|  | PdfDictionary | parameters |
| ) |  |  |

Applies the specified filter to decode the buffer.

Parameters:

  | filter | Filter to use for decoding the buffer.
  | parameters | Decoding parameters.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IBuffer.Delete | ( | int | index,
|  | int | length |
| ) |  |  |

Deletes a byte chunk from the buffer.

Parameters:

  | index | Location at which deletion has to begin.
  | length | Number of bytes to delete.

Implemented in org.pdfclown.bytes.Buffer.

byte [] org.pdfclown.bytes.IBuffer.Encode | ( | Filter | filter,
|  | PdfDictionary | parameters |
| ) |  |  |

Applies the specified filter to encode the buffer.

Parameters:

  | filter | Filter to use for encoding the buffer.
  | parameters | Encoding parameters.

Returns:
  Encoded buffer.

Implemented in org.pdfclown.bytes.Buffer.

int org.pdfclown.bytes.IBuffer.GetByte | ( | int | index | ) |

Gets the byte at a specified location.

Parameters:

  | index | A location in the buffer.

Returns:
  Byte at the specified location.

Implemented in org.pdfclown.bytes.Buffer.

byte [] org.pdfclown.bytes.IBuffer.GetByteArray | ( | int | index,
|  | int | length |
| ) |  |  |

Gets the byte range beginning at a specified location.

Parameters:

  | index | Location at which the byte range has to begin.
  | length | Number of bytes to copy.

Returns:
  Byte range beginning at the specified location.

Implemented in org.pdfclown.bytes.Buffer.

int org.pdfclown.bytes.IInputStream.GetHashCode | ( |  | ) | `[inherited]`

Gets the hash representation of the sequence.

Implemented in org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.util.parsers.PostScriptParser.GetHashCode().

string org.pdfclown.bytes.IBuffer.GetString | ( | int | index,
|  | int | length |
| ) |  |  |

Gets the string beginning at a specified location.

Parameters:

  | index | Location at which the string has to begin.
  | length | Number of bytes to convert.

Returns:
  String beginning at the specified location.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IBuffer.Insert | ( | int | index,
|  | IInputStream | data |
| ) |  |  |

Inserts an IInputStream into the buffer.

Parameters:

  | index | Location at which the IInputStream has to be inserted.
  | data | Source data to copy.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IBuffer.Insert | ( | int | index,
|  | string | data |
| ) |  |  |

Inserts a string into the buffer.

Parameters:

  | index | Location at which the string has to be inserted.
  | data | String to insert.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IBuffer.Insert | ( | int | index,
|  | byte[] | data,
|  | int | offset,
|  | int | length |
| ) |  |  |

Inserts a byte range into the buffer.

Parameters:

  | index | Location at which the byte range has to be inserted.
  | data | Byte array from which the byte range has to be copied.
  | offset | Location in the byte array at which copying begins.
  | length | Number of bytes to copy.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IBuffer.Insert | ( | int | index,
|  | byte[] | data |
| ) |  |  |

Inserts a byte array into the buffer.

Parameters:

  | index | Location at which the byte array has to be inserted.
  | data | Byte array to insert.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IInputStream.Read | ( | byte[] | data,
|  | int | offset,
|  | int | length |
| ) |  |  | `[inherited]`

Reads a sequence of bytes.

This operation causes the stream pointer to advance after the read data.

Parameters:

  | data | Target byte array.
  | offset | Location in the byte array at which storing begins.
  | length | Number of bytes to read.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

void org.pdfclown.bytes.IInputStream.Read | ( | byte[] | data | ) | `[inherited]`

Reads a sequence of bytes.

This operation causes the stream pointer to advance after the read data.

Parameters:

  | data | Target byte array.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.tokens.FileParser.ParsePdfObject(), and org.pdfclown.bytes.Stream.Write().

int org.pdfclown.bytes.IInputStream.ReadByte | ( |  | ) | `[inherited]`

Reads a byte.

This operation causes the stream pointer to advance after the read data.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

int org.pdfclown.bytes.IInputStream.ReadInt | ( | int | length | ) | `[inherited]`

Reads a variable-length integer.

This operation causes the stream pointer to advance after the read data.

Parameters:

  | length | Number of bytes to read.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

int org.pdfclown.bytes.IInputStream.ReadInt | ( |  | ) | `[inherited]`

Reads an integer.

This operation causes the stream pointer to advance after the read data.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.documents.contents.fonts.OpenFontParser.IsOpenFont().

string org.pdfclown.bytes.IInputStream.ReadLine | ( |  | ) | `[inherited]`

Reads the next line of text.

This operation causes the stream pointer to advance after the read data.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.documents.contents.fonts.PfbParser.Parse().

short org.pdfclown.bytes.IInputStream.ReadShort | ( |  | ) | `[inherited]`

Reads a short integer.

This operation causes the stream pointer to advance after the read data.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

sbyte org.pdfclown.bytes.IInputStream.ReadSignedByte | ( |  | ) | `[inherited]`

Reads a signed byte integer.

This operation causes the stream pointer to advance after the read data.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

string org.pdfclown.bytes.IInputStream.ReadString | ( | int | length | ) | `[inherited]`

Reads a string.

This operation causes the stream pointer to advance after the read data.

Parameters:

  | length | Number of bytes to read.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.tokens.FileParser.RetrieveVersion(), and org.pdfclown.tokens.FileParser.RetrieveXRefOffset().

ushort org.pdfclown.bytes.IInputStream.ReadUnsignedShort | ( |  | ) | `[inherited]`

Reads an unsigned short integer.

This operation causes the stream pointer to advance after the read data.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

void org.pdfclown.bytes.IBuffer.Replace | ( | int | index,
|  | IInputStream | data |
| ) |  |  |

Replaces the buffer contents with an IInputStream.

Parameters:

  | index | Location at which the IInputStream has to be copied.
  | data | Source data to copy.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IBuffer.Replace | ( | int | index,
|  | string | data |
| ) |  |  |

Replaces the buffer contents with a string.

Parameters:

  | index | Location at which the string has to be copied.
  | data | String to copy.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IBuffer.Replace | ( | int | index,
|  | byte[] | data,
|  | int | offset,
|  | int | length |
| ) |  |  |

Replaces the buffer contents with a byte range.

Parameters:

  | index | Location at which the byte range has to be copied.
  | data | Byte array from which the byte range has to be copied.
  | offset | Location in the byte array at which copying begins.
  | length | Number of bytes to copy.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IBuffer.Replace | ( | int | index,
|  | byte[] | data |
| ) |  |  |

Replaces the buffer contents with a byte array.

Parameters:

  | index | Location at which the byte array has to be copied.
  | data | Byte array to copy.

Implemented in org.pdfclown.bytes.Buffer.

void org.pdfclown.bytes.IInputStream.Seek | ( | long | position | ) | `[inherited]`

Sets the pointer absolute position.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.tokens.FileParser.MoveNext(), org.pdfclown.tokens.FileParser.ParsePdfObject(), org.pdfclown.tokens.FileParser.RetrieveVersion(), and org.pdfclown.tokens.FileParser.RetrieveXRefOffset().

void org.pdfclown.bytes.IBuffer.SetLength | ( | int | value | ) |

Sets the used buffer size.

Parameters:

  | value | New length.

Implemented in org.pdfclown.bytes.Buffer.

Referenced by org.pdfclown.documents.contents.Contents.Flush().

void org.pdfclown.bytes.IInputStream.Skip | ( | long | offset | ) | `[inherited]`

Sets the pointer relative position.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

byte [] org.pdfclown.util.IDataWrapper.ToByteArray | ( |  | ) | `[inherited]`

Gets the buffer data copied to a newly-allocated byte array.

Implemented in org.pdfclown.bytes.Buffer, org.pdfclown.bytes.Stream, and org.pdfclown.objects.PdfString.

Referenced by org.pdfclown.bytes.Buffer.Append(), org.pdfclown.bytes.Buffer.Insert(), and org.pdfclown.bytes.Buffer.Replace().

void org.pdfclown.bytes.IOutputStream.Write | ( | IInputStream | data | ) | `[inherited]`

Writes an IInputStream into the stream.

Parameters:

  | data | IInputStream to write into the stream.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

void org.pdfclown.bytes.IOutputStream.Write | ( | string | data | ) | `[inherited]`

Writes a string into the stream.

Parameters:

  | data | String to write into the stream.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

void org.pdfclown.bytes.IOutputStream.Write | ( | byte[] | data,
|  | int | offset,
|  | int | length |
| ) |  |  | `[inherited]`

Writes a byte range into the stream.

Parameters:

  | data | Byte array to write into the stream.
  | offset | Location in the byte array at which writing begins.
  | length | Number of bytes to write.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

void org.pdfclown.bytes.IOutputStream.Write | ( | byte[] | data | ) | `[inherited]`

Writes a byte array into the stream.

Parameters:

  | data | Byte array to write into the stream.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.tokens.PlainWriter.WriteIncremental(), org.pdfclown.tokens.CompressedWriter.WriteIncremental(), org.pdfclown.tokens.PlainWriter.WriteStandard(), org.pdfclown.documents.contents.objects.Text.WriteTo(), org.pdfclown.objects.PdfString.WriteTo(), org.pdfclown.objects.PdfStream.WriteTo(), org.pdfclown.objects.PdfReference.WriteTo(), org.pdfclown.objects.PdfReal.WriteTo(), org.pdfclown.objects.PdfName.WriteTo(), org.pdfclown.objects.PdfInteger.WriteTo(), org.pdfclown.objects.PdfIndirectObject.WriteTo(), org.pdfclown.objects.PdfDictionary.WriteTo(), org.pdfclown.objects.PdfBoolean.WriteTo(), org.pdfclown.objects.PdfArray.WriteTo(), org.pdfclown.documents.contents.objects.Operation.WriteTo(), org.pdfclown.documents.contents.objects.MarkedContent.WriteTo(), org.pdfclown.documents.contents.objects.LocalGraphicsState.WriteTo(), org.pdfclown.documents.contents.objects.InlineImageBody.WriteTo(), org.pdfclown.documents.contents.objects.InlineImage.WriteTo(), and org.pdfclown.bytes.Buffer.WriteTo().

void org.pdfclown.bytes.IBuffer.WriteTo | ( | IOutputStream | stream | ) |

Writes the buffer data to a stream.

Parameters:

  | stream | Target stream.

Implemented in org.pdfclown.bytes.Buffer.

## Property Documentation

ByteOrderEnum org.pdfclown.bytes.IInputStream.ByteOrder`[get, set, inherited]`

Gets/Sets the byte order.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

int org.pdfclown.bytes.IBuffer.Capacity`[get]`

Gets the allocated buffer size.

Returns:
  Allocated buffer size.

Implemented in org.pdfclown.bytes.Buffer.

bool org.pdfclown.bytes.IBuffer.Dirty`[get, set]`

Gets/Sets whether this buffer has changed.

Implemented in org.pdfclown.bytes.Buffer.

Referenced by org.pdfclown.objects.PdfStream.PdfStream().

long org.pdfclown.bytes.IStream.Length`[get, inherited]`

Gets the length of the stream.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.bytes.Buffer.Append(), org.pdfclown.tokens.FileParser.RetrieveXRefOffset(), org.pdfclown.bytes.Stream.Write(), org.pdfclown.tokens.PlainWriter.WriteIncremental(), and org.pdfclown.tokens.PlainWriter.WriteStandard().

long org.pdfclown.bytes.IInputStream.Position`[get, set, inherited]`

Gets/Sets the pointer position.

Implemented in org.pdfclown.bytes.Buffer, and org.pdfclown.bytes.Stream.

Referenced by org.pdfclown.documents.contents.fonts.OpenFontParser.IsOpenFont(), org.pdfclown.tokens.FileParser.MoveNext(), org.pdfclown.tokens.FileParser.ParsePdfObject(), org.pdfclown.tokens.FileParser.RetrieveVersion(), org.pdfclown.tokens.FileParser.RetrieveXRefOffset(), and org.pdfclown.bytes.Stream.Write().

## Event Documentation

EventHandler org.pdfclown.bytes.IBuffer.OnChange

Notifies the dirtiness of the observed buffer.

Implemented in org.pdfclown.bytes.Buffer.

Referenced by org.pdfclown.objects.PdfStream.PdfStream().

Copyright 2006-2013 Stefano Chizzolini. For more information, please visit PDF Clown home page.