Skip to content

Request: getByteArray to retrieve a sequence of octets (CON-42) #44

@BrianAdams

Description

@BrianAdams

We are passing around large octet sequences. The good news is that we can access the data through the getJson API. The data comes across as an array of strings that represent the bytes. Thus to get the actual byte Array we have to map the resulting values like this:

var stringdata = input.samples.getJSON(i).payload;
// Convert the ["0x81","0x25"...] to [0x81, 0x25]
var data = stringdata.map(function(item){return Number(item)});

It would be nice to have a way to get the octet sequence directly from the API to avoid the cast to and from JSON string, such as:

var data = input.samples.getByteArray(i,"payload");

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions