byte[] buf = new byte[bos.writerIndex() - 4];
System.arraycopy( bos.array(), 4, buf, 0, bos.writerIndex() - 4 );
ByteArrayInputStream bis = new ByteArrayInputStream( buf);
if ( bis.markSupported() ) {
bis.mark( 0 );
}
TIOStreamTransport transport = new TIOStreamTransport( bis );
TBinaryProtocol protocol = new TBinaryProtocol( transport );