use of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure in project fabric8 by jboss-fuse.
the class OpenWireFormat method tightUnmarshalNestedObject.
public DataStructure tightUnmarshalNestedObject(DataByteArrayInputStream dis, BooleanStream bs) throws IOException {
if (bs.readBoolean()) {
byte dataType = dis.readByte();
DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[dataType & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + dataType);
}
DataStructure data = dsm.createObject();
if (data.isMarshallAware() && bs.readBoolean()) {
dis.readInt();
dis.readByte();
BooleanStream bs2 = new BooleanStream();
bs2.unmarshal(dis);
dsm.tightUnmarshal(this, data, dis, bs2);
// TODO: extract the sequence from the dis and associate it.
// MarshallAware ma = (MarshallAware)data
// ma.setCachedMarshalledForm(this, sequence);
} else {
dsm.tightUnmarshal(this, data, dis, bs);
}
return data;
} else {
return null;
}
}
use of io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure in project fabric8 by jboss-fuse.
the class OpenWireFormat method tightMarshal1.
/**
* Used by NIO or AIO transports
*/
public int tightMarshal1(Object o, BooleanStream bs) throws IOException {
int size = 1;
if (o != null) {
DataStructure c = (DataStructure) o;
byte type = c.getDataStructureType();
DataStreamMarshaller dsm = (DataStreamMarshaller) dataMarshallers[type & 0xFF];
if (dsm == null) {
throw new IOException("Unknown data type: " + type);
}
size += dsm.tightMarshal1(this, c, bs);
size += bs.marshalledSize();
}
return size;
}
Aggregations