Package org.fusesource.hawtbuf

Examples of org.fusesource.hawtbuf.DataByteArrayInputStream


    @Override
    protected void processCommand(ByteBuffer plain) throws Exception {
        byte[] fill = new byte[plain.remaining()];
        plain.get(fill);
        DataByteArrayInputStream dis = new DataByteArrayInputStream(fill);
        codec.parse(dis, fill.length);
    }
View Full Code Here


    }

    public static Properties stringToProperties(String str) throws IOException {
        Properties result = new Properties();
        if (str != null && str.length() > 0) {
            DataByteArrayInputStream dataIn = new DataByteArrayInputStream(str.getBytes());
            result.load(dataIn);
            dataIn.close();
        }
        return result;
    }
View Full Code Here

        return new ProxyInvocationHandler(address, service, classLoader);
    }

    protected void onCommand(TransportPool pool, Object data) {
        try {
            DataByteArrayInputStream bais = new DataByteArrayInputStream( (Buffer) data);
            int size = bais.readInt();
            long correlation = bais.readVarLong();
            pool.onDone(correlation);
            ResponseFuture response = requests.remove(correlation);
            if( response!=null ) {
                response.set(bais);
            }
View Full Code Here

            dataOut.writeByte(NULL_TYPE);
        }
    }

    public Object unmarshal(DataByteArrayInputStream dis) throws IOException {
        DataByteArrayInputStream dataIn = dis;
        if (!sizePrefixDisabled) {
            int size = dis.readInt();
            if (size > maxFrameSize) {
                throw new IOException(
                        "Frame size of " + (size / (1024 * 1024)) +
View Full Code Here

        keyCodec.encode(key, baos);
        return baos.toBuffer();
    }

    public String unmarshallKey(Buffer buffer) throws IOException {
        DataByteArrayInputStream bais = new DataByteArrayInputStream(buffer);
        String key = keyCodec.decode(bais);
        return key;
    }
View Full Code Here

        exchangeCodec.encode(pe, baos);
        return baos.toBuffer();
    }

    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");
View Full Code Here

TOP

Related Classes of org.fusesource.hawtbuf.DataByteArrayInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.