Search in sources :

Example 1 with AbsContentContainer

use of im.actor.core.entity.content.internal.AbsContentContainer in project actor-platform by actorapp.

the class AbsContent method parse.

public static AbsContent parse(byte[] data) throws IOException {
    BserValues reader = new BserValues(BserParser.deserialize(new DataInput(data)));
    AbsContentContainer container;
    // Is New Layout
    if (reader.getBool(32, false)) {
        container = AbsContentContainer.loadContainer(reader.getBytes(33));
    } else {
        throw new RuntimeException("Unsupported obsolete format");
    }
    return convertData(container);
}
Also used : DataInput(im.actor.runtime.bser.DataInput) AbsContentContainer(im.actor.core.entity.content.internal.AbsContentContainer) BserValues(im.actor.runtime.bser.BserValues)

Aggregations

AbsContentContainer (im.actor.core.entity.content.internal.AbsContentContainer)1 BserValues (im.actor.runtime.bser.BserValues)1 DataInput (im.actor.runtime.bser.DataInput)1