Examples of ChannelBufferInputStream


Examples of org.jboss.netty.buffer.ChannelBufferInputStream

        if (rc != BKException.Code.OK) {
            logErrorAndReattemptRead(entry, "Error: " + BKException.getMessage(rc), rc);
            return;
        }

        ChannelBufferInputStream is;
        try {
            is = lh.macManager.verifyDigestAndReturnData(entryId, buffer);
        } catch (BKDigestMatchException e) {
            logErrorAndReattemptRead(entry, "Mac mismatch", BKException.Code.DigestMatchException);
            return;
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

     */
    ChannelBufferInputStream verifyDigestAndReturnData(long entryId, ChannelBuffer dataReceived)
            throws BKDigestMatchException {
        verifyDigest(entryId, dataReceived);
        dataReceived.readerIndex(METADATA_LENGTH + macCodeLength);
        return new ChannelBufferInputStream(dataReceived);
    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

        return new String(bytes);
    }

    @Converter
    public static InputStream toInputStream(ChannelBuffer buffer) {
        return new ChannelBufferInputStream(buffer);
    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

        return exchange.getContext().getTypeConverter().convertTo(String.class, exchange, bytes);
    }

    @Converter
    public static InputStream toInputStream(ChannelBuffer buffer) {
        return new ChannelBufferInputStream(buffer);
    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

        }

        // return true if we managed to complete the entry
        // return false if the read entry is not complete or it is already completed before
        boolean complete(InetSocketAddress host, final ChannelBuffer buffer) {
            ChannelBufferInputStream is;
            try {
                is = lh.macManager.verifyDigestAndReturnData(entryId, buffer);
            } catch (BKDigestMatchException e) {
                logErrorAndReattemptRead(host, "Mac mismatch", BKException.Code.DigestMatchException);
                return false;
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

     */
    ChannelBufferInputStream verifyDigestAndReturnData(long entryId, ChannelBuffer dataReceived)
            throws BKDigestMatchException {
        verifyDigest(entryId, dataReceived);
        dataReceived.readerIndex(METADATA_LENGTH + macCodeLength);
        return new ChannelBufferInputStream(dataReceived);
    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

        return new String(bytes, "UTF-8");
    }

    @Converter
    public static InputStream toInputStream(ChannelBuffer buffer, Exchange exchange) {
        return new ChannelBufferInputStream(buffer);
    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

                body = new ByteArrayInputStream(new byte[0]);
            }

        } else {
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            IOUtils.copy(new ChannelBufferInputStream(b), out);
            byte[] n = out.toByteArray();
            body = new ByteArrayInputStream(n);
        }

        String host = nettyRequest.getHeader(HOST);
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

        return exchange.getContext().getTypeConverter().convertTo(String.class, exchange, bytes);
    }

    @Converter
    public static InputStream toInputStream(ChannelBuffer buffer) {
        return new ChannelBufferInputStream(buffer);
    }
View Full Code Here

Examples of org.jboss.netty.buffer.ChannelBufferInputStream

        List<SyncMessage> ms = null;
        ChannelBuffer frame = null;
        while (null != (frame = (ChannelBuffer) super.decode(ctx, channel,
                                                             buffer))) {
            if (ms == null) ms = new ArrayList<SyncMessage>();
            ChannelBufferInputStream is = new ChannelBufferInputStream(frame);
            TCompactProtocol thriftProtocol =
                    new TCompactProtocol(new TIOStreamTransport(is));
            SyncMessage bsm = new SyncMessage();
            bsm.read(thriftProtocol);
            ms.add(bsm);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.