PeterO.ArrayWriter

## PeterO.ArrayWriter

public sealed class ArrayWriter :
    PeterO.IByteWriter,
    PeterO.IWriter

An array of bytes that grows as needed.

Member Summary

### ArrayWriter Constructor

public ArrayWriter(
    int initialSize);

Initializes a new instance of the PeterO.ArrayWriter class.

Parameters:

### ArrayWriter Constructor

public ArrayWriter();

Initializes a new instance of the PeterO.ArrayWriter class with a default backing store size of 16.

### Clear

public void Clear();

Offers a fast way to reset the length of the array writer’s data to 0.

### ToArray

public byte[] ToArray();

Generates an array of all bytes written so far to it.

Return Value:

A byte array.

### Write

public sealed void Write(
    byte[] src,
    int offset,
    int length);

Writes a series of bytes to the array.

Parameters:

Exceptions:

### WriteByte

public sealed void WriteByte(
    int byteValue);

Writes an 8-bit byte to the array.

Parameters:

Back to Encoding start page.