public class ByteDataAccessSimple extends ByteDataAccessBase
ByteDataAccess accMy = new ByteDataAccessSimple(data); //we have not head data addMy.addChild(anyChild); //but there is a structure with children
Use this class as reference to access to any byte position:ByteDataAccessSimple accMy = new ByteDataAccessSimple(data); //any access to byte data necessary accMy.setIntVal(ix, 3, value); //sets the int value with 24 bit, it is an example float var = accMy.getFloatVal(24); //gets the bytes from position 24 and present them as float.In that case you can add children too, there are added from position 0. But it is not a good style to mix the both aproaches.
InfoFormattedAppend.PrepareToString
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
version
Version, history and license
2018-09-17 Hartmut The class might to be use only for writing.
|
bBigEndian, bExc, bLittleEndianBig2, data, sizeHead, toStringformatter
Constructor and Description |
---|
ByteDataAccessSimple(boolean bigEndian)
Constructs a new instance not assigned, to read several buffers.
|
ByteDataAccessSimple(byte[] data,
boolean bigEndian)
Constructs a new instance which is assigned to an empty buffer.
|
ByteDataAccessSimple(byte[] data,
boolean bigEndian,
int lengthData)
Constructs a new instance which is assigned to an filled buffer.
|
ByteDataAccessSimple(byte[] data,
boolean bigEndian,
int lengthData,
int index)
Constructs a new instance which is assigned to an filled buffer.
|
Modifier and Type | Method and Description |
---|---|
double |
getDoubleVal(int idx)
Gets a double value from any offset started from the current child element
|
float |
getFloatVal(int idx)
Gets a float value from any offset started from the current child element
|
int |
getIntVal(int idx,
int nrofBytes)
Gets a integer value from any offset started from the current child element
|
long |
getLongVal(int idx,
int nrofBytes)
Gets a integer value from any offset started from the current child element
|
void |
setDoubleVal(int idx,
double value) |
void |
setFloatVal(int idx,
float value) |
void |
setIntVal(int idx,
int nrofBytes,
long value) |
_getInt, _getLong, _setInt, _setLong, _setString, addChild, addChild, addChildAt, addChildAt, addChildEmpty, addChildEmpty, addChildFloat, addChildInt, addChildInteger, addChildString, addChildString, addChildString, assign, assign, assign, assignAt, assignAt, assignCasted, assignClear, assignDataToFixChildren, checkData, checkLengthElement, clearData, clearHead, copyData, copyDataFrom, data, detach, getBigEndian, getChar, getChildDouble, getChildFloat, getChildInt, getChildInt16, getChildInteger, getChildString, getChildUint16, getChildUint8, getData, getDouble, getFloat, getFloat, getInt16, getInt16, getInt32, getInt32, getInt64, getInt8, getInt8, getLength, getLengthCurrent, getLengthHead, getLengthTotal, getMaxNrofBytes, getMaxNrofBytesForNextChild, getPositionInBuffer, getPositionNextChildInBuffer, getString, getUint16, getUint16, getUint32, getUint32, getUint8, getUint8, infoAppendHead, infoFormattedAppend, isCurrentChildInParent, isExpandable, isInUse, ixBegin, ixEnd, ixNextChild, removeChild, removeChild, removeChildren, setBigEndian, setCharset, setDouble, setException, setFloat, setFloat, setInt16, setInt16, setInt32, setInt32, setInt8, setInt8, setLengthElement, setLittleEndianBig2, setString, setUint16, setUint16, setUint32, setUint32, setUint8, setUint8, sizeHead, sufficingBytesForNextChild, toString, upcast, XXXrewind
public static final java.lang.String version
ByteDataAccessSimple(byte[], boolean, int)
are documented with 'filled Buffer'
but they had clean it. Now correct adequate documentation.
public ByteDataAccessSimple(byte[] data, boolean bigEndian)
public ByteDataAccessSimple(boolean bigEndian)
public ByteDataAccessSimple(byte[] data, boolean bigEndian, int lengthData)
public ByteDataAccessSimple(byte[] data, boolean bigEndian, int lengthData, int index)
public final long getLongVal(int idx, int nrofBytes)
idx
- byte-offset, the offset is not tested. If the offset is wrong, a null-pointer-exception throws.nrofBytes
- to read.public final int getIntVal(int idx, int nrofBytes)
idx
- byte-offset, the offset is not tested. If the offset is wrong, a null-pointer-exception throws.nrofBytes
- to read.public final float getFloatVal(int idx)
idx
- byte-offset, the offset is not tested. If the offset is wrong, a null-pointer-exception throws.public final double getDoubleVal(int idx)
idx
- byte-offset, the offset is not tested. If the offset is wrong, a null-pointer-exception throws.public final void setIntVal(int idx, int nrofBytes, long value)
public final void setFloatVal(int idx, float value)
public final void setDoubleVal(int idx, double value)