Table of Contents

Class ByteVector

Namespace
iText.Layout.Hyphenation
Assembly
itext.layout.dll

This class implements a simple byte vector with access to the underlying array.

public class ByteVector
Inheritance
ByteVector
Inherited Members

Remarks

This class implements a simple byte vector with access to the underlying array.

This work was authored by Carlos Villegas (cav@uniscope.co.jp).

Constructors

ByteVector()

Construct byte vector instance with default block size.

public ByteVector()

ByteVector(byte[])

Construct byte vector instance.

public ByteVector(byte[] a)

Parameters

a byte[]

byte array to use TODO should n should be initialized to a.length to be consistent with CharVector behavior? [GA]

ByteVector(byte[], int)

Construct byte vector instance.

public ByteVector(byte[] a, int capacity)

Parameters

a byte[]

byte array to use

capacity int

initial block size TODO should n should be initialized to a.length to be consistent with CharVector behavior? [GA]

ByteVector(int)

Construct byte vector instance.

public ByteVector(int capacity)

Parameters

capacity int

initial block size

Methods

Alloc(int)

This is to implement memory allocation in the array.

public virtual int Alloc(int size)

Parameters

size int

to allocate

Returns

int

previous length

Remarks

This is to implement memory allocation in the array. Like malloc().

Capacity()

Obtain capacity of array.

public virtual int Capacity()

Returns

int

current capacity of array

Get(int)

Get byte at index.

public virtual byte Get(int index)

Parameters

index int

the index

Returns

byte

a byte

GetArray()

Obtain byte vector array.

public virtual byte[] GetArray()

Returns

byte[]

byte array

Length()

Obtain number of items in array.

public virtual int Length()

Returns

int

number of items

Put(int, byte)

Pet byte at index.

public virtual void Put(int index, byte val)

Parameters

index int

the index

val byte

a byte

TrimToSize()

Trim byte vector to current length.

public virtual void TrimToSize()