Package com.alibaba.dubbo.rpc.protocol.thrift.io

Examples of com.alibaba.dubbo.rpc.protocol.thrift.io.RandomAccessByteArrayOutputStream.toByteArray()


        } catch ( TException e ) {
            throw new RpcException( RpcException.SERIALIZATION_EXCEPTION, e.getMessage(), e );
        }

        buffer.writeBytes(bytes);
        buffer.writeBytes(bos.toByteArray());

    }

    private void encodeResponse( Channel channel, ChannelBuffer buffer, Response response )
            throws IOException {
View Full Code Here


        } catch ( TException e ) {
            throw new RpcException( RpcException.SERIALIZATION_EXCEPTION, e.getMessage(), e );
        }

        buffer.writeBytes(bytes);
        buffer.writeBytes(bos.toByteArray());

    }

    private static int nextSeqId() {
        return THRIFT_SEQ_ID.incrementAndGet();
View Full Code Here

            bos.setWriteIndex( oldIndex );
        }
        // prepare

        byte[] buf = new byte[ 4 + bos.size()];
        System.arraycopy( bos.toByteArray(), 0, buf, 4, bos.size() );

        ChannelBuffer bis = ChannelBuffers.wrappedBuffer(buf);

        Object obj = codec.decode( ( Channel ) null, bis );
View Full Code Here

        } finally {
            bos.setWriteIndex( oldIndex );
        }
        // prepare

        ChannelBuffer bis = ChannelBuffers.wrappedBuffer(encodeFrame(bos.toByteArray()));

        Object obj = codec.decode( ( Channel ) null, bis );

        Assert.assertNotNull( obj );
View Full Code Here

        } finally {
            bos.setWriteIndex( oldIndex );
        }

        Object obj = codec.decode( ( Channel ) null, ChannelBuffers.wrappedBuffer(
            encodeFrame(bos.toByteArray())) );

        Assert.assertTrue( obj instanceof Request );

        obj = ( ( Request ) obj ).getData();
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.