APIdia Launch Partner
Top Description Inners Fields Constructors Methods
io.github.spannm.jackcess.impl

public Class ByteArrayBuilder

extends Object
Class Inheritance
Imports
java.nio.ByteBuffer, java.util.ArrayList, .List

Utility class for constructing byte[]s where the final size of the data is not known beforehand. The API is similar to ByteBuffer but the data is not actually written to a byte[] until toBuffer or toArray is called.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private abstract static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final List<ByteArrayBuilder.Data>
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int
public ByteArrayBuilder
put(byte val)

public ByteArrayBuilder
put(byte[] val)

public ByteArrayBuilder
private ByteArrayBuilder
public ByteArrayBuilder
putInt(int val)

public ByteArrayBuilder
putInt(int atPos, int val)

public ByteArrayBuilder
putShort(short val)

public ByteArrayBuilder
putShort(int atPos, short val)

public ByteArrayBuilder
reserve(int bytes)

public ByteArrayBuilder
public ByteArrayBuilder
public byte[]
public ByteBuffer
public ByteBuffer
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
private final List<ByteArrayBuilder.Data> data
posback to summary
private int pos

Constructor Detail

ByteArrayBuilderback to summary
public ByteArrayBuilder()

Method Detail

positionback to summary
public int position()
putback to summary
public ByteArrayBuilder put(byte val)
putback to summary
public ByteArrayBuilder put(byte[] val)
putback to summary
public ByteArrayBuilder put(ByteBuffer val)
putback to summary
private ByteArrayBuilder put(ByteArrayBuilder.Data newData)
putIntback to summary
public ByteArrayBuilder putInt(int val)
putIntback to summary
public ByteArrayBuilder putInt(int atPos, int val)
putShortback to summary
public ByteArrayBuilder putShort(short val)
putShortback to summary
public ByteArrayBuilder putShort(int atPos, short val)
reserveback to summary
public ByteArrayBuilder reserve(int bytes)
reserveIntback to summary
public ByteArrayBuilder reserveInt()
reserveShortback to summary
public ByteArrayBuilder reserveShort()
toArrayback to summary
public byte[] toArray()
toBufferback to summary
public ByteBuffer toBuffer()
toBufferback to summary
public ByteBuffer toBuffer(ByteBuffer buf)
io.github.spannm.jackcess.impl back to summary

private final Class ByteArrayBuilder.BufData

extends Data
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final ByteBuffer

Constructor Summary

AccessConstructor and Description
private
BufData(int pos, ByteBuffer val)

Method Summary

Modifier and TypeMethod and Description
public int
public void
Inherited from io.github.spannm.jackcess.impl.ByteArrayBuilder.Data:
getEndPosgetPos

Field Detail

valback to summary
private final ByteBuffer val

Constructor Detail

BufDataback to summary
private BufData(int pos, ByteBuffer val)

Method Detail

sizeback to summary
public int size()

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.size.

Annotations
@Override
writeback to summary
public void write(ByteBuffer buf)

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.write.

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

private final Class ByteArrayBuilder.ByteData

extends Data
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final byte

Constructor Summary

AccessConstructor and Description
private
ByteData(int pos, byte val)

Method Summary

Modifier and TypeMethod and Description
public int
public void
Inherited from io.github.spannm.jackcess.impl.ByteArrayBuilder.Data:
getEndPosgetPos

Field Detail

valback to summary
private final byte val

Constructor Detail

ByteDataback to summary
private ByteData(int pos, byte val)

Method Detail

sizeback to summary
public int size()

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.size.

Annotations
@Override
writeback to summary
public void write(ByteBuffer buf)

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.write.

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

private final Class ByteArrayBuilder.BytesData

extends Data
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final byte[]

Constructor Summary

AccessConstructor and Description
private
BytesData(int pos, byte[] val)

Method Summary

Modifier and TypeMethod and Description
public int
public void
Inherited from io.github.spannm.jackcess.impl.ByteArrayBuilder.Data:
getEndPosgetPos

Field Detail

valback to summary
private final byte[] val

Constructor Detail

BytesDataback to summary
private BytesData(int pos, byte[] val)

Method Detail

sizeback to summary
public int size()

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.size.

Annotations
@Override
writeback to summary
public void write(ByteBuffer buf)

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.write.

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

private abstract Class ByteArrayBuilder.Data

extends Object
Class Inheritance
Known Direct Subclasses
io.github.spannm.jackcess.impl.ByteArrayBuilder.IntData, io.github.spannm.jackcess.impl.ByteArrayBuilder.ShortData, io.github.spannm.jackcess.impl.ByteArrayBuilder.ByteData, io.github.spannm.jackcess.impl.ByteArrayBuilder.BytesData, io.github.spannm.jackcess.impl.ByteArrayBuilder.BufData

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
protected
Data(int pos)

Method Summary

Modifier and TypeMethod and Description
public int
public int
public abstract int
size()

public abstract void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

posback to summary
private final int pos

Constructor Detail

Databack to summary
protected Data(int pos)

Method Detail

getEndPosback to summary
public int getEndPos()
getPosback to summary
public int getPos()
sizeback to summary
public abstract int size()
writeback to summary
public abstract void write(ByteBuffer buf)
io.github.spannm.jackcess.impl back to summary

private final Class ByteArrayBuilder.IntData

extends Data
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
private
IntData(int pos, int val)

Method Summary

Modifier and TypeMethod and Description
public int
public void
Inherited from io.github.spannm.jackcess.impl.ByteArrayBuilder.Data:
getEndPosgetPos

Field Detail

valback to summary
private final int val

Constructor Detail

IntDataback to summary
private IntData(int pos, int val)

Method Detail

sizeback to summary
public int size()

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.size.

Annotations
@Override
writeback to summary
public void write(ByteBuffer buf)

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.write.

Annotations
@Override
io.github.spannm.jackcess.impl back to summary

private final Class ByteArrayBuilder.ShortData

extends Data
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final short

Constructor Summary

AccessConstructor and Description
private
ShortData(int pos, short val)

Method Summary

Modifier and TypeMethod and Description
public int
public void
Inherited from io.github.spannm.jackcess.impl.ByteArrayBuilder.Data:
getEndPosgetPos

Field Detail

valback to summary
private final short val

Constructor Detail

ShortDataback to summary
private ShortData(int pos, short val)

Method Detail

sizeback to summary
public int size()

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.size.

Annotations
@Override
writeback to summary
public void write(ByteBuffer buf)

Implements abstract io.github.spannm.jackcess.impl.ByteArrayBuilder.Data.write.

Annotations
@Override