use of org.fusesource.hawtbuf.DataByteArrayInputStream in project camel by apache.
the class HawtDBCamelCodec method unmarshallKey.
public String unmarshallKey(Buffer buffer) throws IOException {
DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
String key = keyCodec.decode(bais);
return key;
}
use of org.fusesource.hawtbuf.DataByteArrayInputStream in project camel by apache.
the class HawtDBCamelCodec method unmarshallExchange.
public Exchange unmarshallExchange(CamelContext camelContext, Buffer buffer) throws IOException {
DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
DefaultExchangeHolder pe = exchangeCodec.decode(bais);
Exchange answer = new DefaultExchange(camelContext);
DefaultExchangeHolder.unmarshal(answer, pe);
// restore the from endpoint
String fromEndpointUri = (String) answer.removeProperty("CamelAggregatedFromEndpoint");
if (fromEndpointUri != null) {
Endpoint fromEndpoint = camelContext.hasEndpoint(fromEndpointUri);
if (fromEndpoint != null) {
answer.setFromEndpoint(fromEndpoint);
}
}
return answer;
}
use of org.fusesource.hawtbuf.DataByteArrayInputStream in project camel by apache.
the class LevelDBCamelCodec method unmarshallKey.
public String unmarshallKey(Buffer buffer) throws IOException {
DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
String key = keyCodec.decode(bais);
return key;
}
use of org.fusesource.hawtbuf.DataByteArrayInputStream in project camel by apache.
the class LevelDBCamelCodec method unmarshallExchange.
public Exchange unmarshallExchange(CamelContext camelContext, Buffer buffer) throws IOException {
DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
DefaultExchangeHolder pe = exchangeCodec.decode(bais);
Exchange answer = new DefaultExchange(camelContext);
DefaultExchangeHolder.unmarshal(answer, pe);
// restore the from endpoint
String fromEndpointUri = (String) answer.removeProperty("CamelAggregatedFromEndpoint");
if (fromEndpointUri != null) {
Endpoint fromEndpoint = camelContext.hasEndpoint(fromEndpointUri);
if (fromEndpoint != null) {
answer.setFromEndpoint(fromEndpoint);
}
}
return answer;
}
Aggregations