Closed
Description
I generated Java code for a message schema with variable-length data. The generated code has functions set and get the length of the data but not a direct way to locate the data in the buffer or to populate it. Not sure how to use this. It seems to me that a method to set data into the field should also set its length.
The encoding is this:
The field is defined this way:
The generated code:
/* Generated SBE (Simple Binary Encoding) message codec */
package MarketData;
import java.nio.ByteOrder;
import java.util.;
import uk.co.real_logic.sbe.generation.java.;
public class DATA implements FixedFlyweight
{
private DirectBuffer buffer;
private int offset;
public DATA reset(final DirectBuffer buffer, final int offset)
{
this.buffer = buffer;
this.offset = offset;
return this;
}
public int size()
{
return -1;
}
public int length()
{
return CodecUtil.uint16Get(buffer, offset + 0, ByteOrder.LITTLE_ENDIAN);
}
public DATA length(final int value)
{
CodecUtil.uint16Put(buffer, offset + 0, value, ByteOrder.LITTLE_ENDIAN);
return this;
}
}
Metadata
Metadata
Assignees
Labels
No labels