public class ByteBuffer extends OutputStream
StringBuffer but works with byte arrays.
Floating point is converted to a format suitable to the PDF.| Constructor and Description |
|---|
ByteBuffer()
Creates new ByteBuffer with capacity 128
|
ByteBuffer(int size)
Creates a byte buffer with a certain capacity.
|
| Modifier and Type | Method and Description |
|---|---|
ByteBuffer |
append_i(int b)
Appends an
int. |
ByteBuffer |
append(byte b) |
byte[] |
getBuffer() |
void |
setSize(int size) |
byte[] |
toByteArray()
Creates a newly allocated byte array.
|
String |
toString()
Converts the buffer's contents into a string, translating bytes into
characters according to the platform's default character encoding.
|
void |
write(byte[] b,
int off,
int len) |
void |
write(int b) |
close, flush, writepublic ByteBuffer()
public ByteBuffer(int size)
size - the initial capacitypublic ByteBuffer append_i(int b)
int. The size of the array will grow by one.b - the int to be appendedByteBuffer objectpublic ByteBuffer append(byte b)
public byte[] toByteArray()
public void setSize(int size)
public String toString()
public void write(int b)
throws IOException
write in class OutputStreamIOExceptionpublic void write(byte[] b,
int off,
int len)
write in class OutputStreampublic byte[] getBuffer()
Copyright © 2021. All rights reserved.