Package com.bc.ceres.binio.util
Class ByteArrayCodec
java.lang.Object
com.bc.ceres.binio.util.ByteArrayCodec
A utility class used to decode/encode primitive Java types from/to a byte buffer using
a specified
ByteOrder
.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal byte
getByte
(byte[] b, int boff) abstract ByteOrder
final void
getBytes
(byte[] b, int boff, byte[] v, int voff, int vlen) abstract double
getDouble
(byte[] b, int boff) abstract void
getDoubles
(byte[] b, int boff, double[] v, int voff, int vlen) abstract float
getFloat
(byte[] b, int boff) abstract void
getFloats
(byte[] b, int boff, float[] v, int voff, int vlen) static ByteArrayCodec
getInstance
(ByteOrder byteOrder) abstract int
getInt
(byte[] b, int boff) abstract void
getInts
(byte[] b, int boff, int[] v, int voff, int vlen) abstract long
getLong
(byte[] b, int boff) abstract void
getLongs
(byte[] b, int boff, long[] v, int voff, int vlen) abstract short
getShort
(byte[] b, int boff) abstract void
getShorts
(byte[] b, int boff, short[] v, int voff, int vlen) final void
setByte
(byte[] b, int boff, byte v) final void
setBytes
(byte[] b, int boff, byte[] v, int voff, int vlen) abstract void
setDouble
(byte[] b, int boff, double v) abstract void
setDoubles
(byte[] b, int boff, double[] v, int voff, int vlen) abstract void
setFloat
(byte[] b, int boff, float v) abstract void
setFloats
(byte[] b, int boff, float[] v, int voff, int vlen) abstract void
setInt
(byte[] b, int boff, int v) abstract void
setInts
(byte[] b, int boff, int[] v, int voff, int vlen) abstract void
setLong
(byte[] b, int boff, long v) abstract void
setLongs
(byte[] b, int boff, long[] v, int voff, int vlen) abstract void
setShort
(byte[] b, int boff, short v) abstract void
setShorts
(byte[] b, int boff, short[] v, int voff, int vlen)
-
Field Details
-
LITTLE_ENDIAN
-
BIG_ENDIAN
-
-
Constructor Details
-
ByteArrayCodec
protected ByteArrayCodec()
-
-
Method Details
-
getInstance
-
getByteOrder
-
getByte
public final byte getByte(byte[] b, int boff) -
getShort
public abstract short getShort(byte[] b, int boff) -
getInt
public abstract int getInt(byte[] b, int boff) -
getLong
public abstract long getLong(byte[] b, int boff) -
getFloat
public abstract float getFloat(byte[] b, int boff) -
getDouble
public abstract double getDouble(byte[] b, int boff) -
getBytes
public final void getBytes(byte[] b, int boff, byte[] v, int voff, int vlen) -
getShorts
public abstract void getShorts(byte[] b, int boff, short[] v, int voff, int vlen) -
getInts
public abstract void getInts(byte[] b, int boff, int[] v, int voff, int vlen) -
getLongs
public abstract void getLongs(byte[] b, int boff, long[] v, int voff, int vlen) -
getFloats
public abstract void getFloats(byte[] b, int boff, float[] v, int voff, int vlen) -
getDoubles
public abstract void getDoubles(byte[] b, int boff, double[] v, int voff, int vlen) -
setByte
public final void setByte(byte[] b, int boff, byte v) -
setShort
public abstract void setShort(byte[] b, int boff, short v) -
setInt
public abstract void setInt(byte[] b, int boff, int v) -
setLong
public abstract void setLong(byte[] b, int boff, long v) -
setFloat
public abstract void setFloat(byte[] b, int boff, float v) -
setDouble
public abstract void setDouble(byte[] b, int boff, double v) -
setBytes
public final void setBytes(byte[] b, int boff, byte[] v, int voff, int vlen) -
setShorts
public abstract void setShorts(byte[] b, int boff, short[] v, int voff, int vlen) -
setInts
public abstract void setInts(byte[] b, int boff, int[] v, int voff, int vlen) -
setLongs
public abstract void setLongs(byte[] b, int boff, long[] v, int voff, int vlen) -
setFloats
public abstract void setFloats(byte[] b, int boff, float[] v, int voff, int vlen) -
setDoubles
public abstract void setDoubles(byte[] b, int boff, double[] v, int voff, int vlen)
-