Javolution - reading variable-length string

507 Views Asked by At

How to read variable length String from a C struct using Javolution API?

For example the code below is used to get a fixed size String- public final UTF8String data= new UTF8String(100);

Can anyone give me an example for reading variable length String.

1

There are 1 best solutions below

0
On

This is what we have and we are learning as well:

public class EvDasTestResults extends AbstractServiceJavolutionObject
{
    public final Signed32 result = new Signed32();
    public final UTF8String description;


    public EvDasTestResults(int size)
    {
        description = new UTF8String(size);
    }
}

public abstract class AbstractServiceJavolutionObject extends Struct
{
    @Override
    public ByteOrder byteOrder()
    {
        return ByteOrder.nativeOrder();
    }

    @Override
    public boolean isPacked() 
    {
        return true; 
    }
}