public final class ArrayWriter extends Object implements IWriter
| Constructor and Description |
|---|
ArrayWriter()
Initializes a new instance of the
com.upokecenter.ArrayWriter class
with a default buffer size. |
ArrayWriter(int initialSize)
Initializes a new instance of the
com.upokecenter.ArrayWriter class
with the given initial buffer size. |
| Modifier and Type | Method and Description |
|---|---|
void |
Clear()
Offers a fast way to reset the length of the array writer's data to 0.
|
byte[] |
ToArray()
Generates an array of all bytes written so far to it.
|
void |
write(byte[] src,
int offset,
int length)
Writes a series of bytes to the array.
|
void |
write(int byteValue)
Writes an 8-bit byte to the array.
|
public ArrayWriter()
com.upokecenter.ArrayWriter class
with a default buffer size.public ArrayWriter(int initialSize)
com.upokecenter.ArrayWriter class
with the given initial buffer size.initialSize - The parameter initialSize is a 32-bit signed
integer.public void Clear()
public byte[] ToArray()
public void write(int byteValue)
write in interface IByteWriterbyteValue - An integer containing the byte to write. Only the lower 8
bits of this value will be used.public void write(byte[] src,
int offset,
int length)
write in interface IWritersrc - Byte array containing the data to write.offset - A zero-based index showing where the desired portion of src begins.length - The number of elements in the desired portion of src
(but not more than src 's length).NullPointerException - The parameter src is null.IllegalArgumentException - Either offset or length is
less than 0 or greater than src 's length, or src ' s
length minus offset is less than length.Encoding for Java documentation, generated in 2017.