JBBPByteOrder may add nativeOrder and inheritOrder
wjtxyz opened this issue · 3 comments
wjtxyz commented
JBBPOut use the Object's @bin annotation ByteOrder instead of inherit the ByteOrder from JBBPOut constructor when call JBBPOut.Bin(Object)
example:
`
byte[] bins = JBBPOut.BeginBin(JBBPByteOrder.LITTLE_ENDIAN).Int(123).Bin(new CommandData(123)).End().toByteArray();
//actually, bins=[123, 0, 0, 0, 0, 0, 0, 123], but i want bins=[123, 0, 0, 0, 123, 0, 0, 0]
static class CommandData{
@Bin(order = 1)
int data;
public CommandData(int data) {
this.data = data;
}
}
`
raydac commented
am I correct that you have @Bin
annotated object where directly defined ByteOrder and you want override order provided in @Bin
by order provided in JBBPOut?
wjtxyz commented
am I correct that you have
@Bin
annotated object where directly defined ByteOrder and you want override order provided in@Bin
by order provided in JBBPOut?
yes
raydac commented
I have added into 2.0.2-SNAPSHOT new method JBBPOut#BinForceByteOrder