Class ByteArrayBuilder
- java.lang.Object
-
- com.healthmarketscience.jackcess.impl.ByteArrayBuilder
-
public class ByteArrayBuilder extends Object
Utility class for constructingbyte[]swhere the final size of the data is not known beforehand. The API is similar toByteBufferbut the data is not actually written to abyte[]untiltoBuffer()ortoArray()is called.- Author:
- James Ahlborn
-
-
Constructor Summary
Constructors Constructor Description ByteArrayBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intposition()ByteArrayBuilderput(byte val)ByteArrayBuilderput(byte[] val)ByteArrayBuilderput(ByteBuffer val)ByteArrayBuilderputInt(int val)ByteArrayBuilderputInt(int pos, int val)ByteArrayBuilderputShort(int pos, short val)ByteArrayBuilderputShort(short val)ByteArrayBuilderreserve(int bytes)ByteArrayBuilderreserveInt()ByteArrayBuilderreserveShort()byte[]toArray()ByteBuffertoBuffer()ByteBuffertoBuffer(ByteBuffer buf)
-
-
-
Method Detail
-
position
public int position()
-
reserveInt
public ByteArrayBuilder reserveInt()
-
reserveShort
public ByteArrayBuilder reserveShort()
-
reserve
public ByteArrayBuilder reserve(int bytes)
-
put
public ByteArrayBuilder put(byte val)
-
putInt
public ByteArrayBuilder putInt(int val)
-
putInt
public ByteArrayBuilder putInt(int pos, int val)
-
putShort
public ByteArrayBuilder putShort(short val)
-
putShort
public ByteArrayBuilder putShort(int pos, short val)
-
put
public ByteArrayBuilder put(byte[] val)
-
put
public ByteArrayBuilder put(ByteBuffer val)
-
toBuffer
public ByteBuffer toBuffer()
-
toBuffer
public ByteBuffer toBuffer(ByteBuffer buf)
-
toArray
public byte[] toArray()
-
-