Skip to content

JBBPByteOrder may add nativeOrder and inheritOrder #28

Closed
@wjtxyz

Description

@wjtxyz

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;
    }
}

`

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions