开发者

Javolution - reading variable-length string

开发者 https://www.devze.com 2023-03-23 07:22 出处:网络
How to read variable length String from a C struct using Javolution API? For e开发者_运维百科xample the code below is used to get a fixed size String-

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

For e开发者_运维百科xample 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.


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

精彩评论

暂无评论...
验证码 换一张
取 消