/** * Write a byte array, using a varint for the size. */ public void writeBinary(ByteBuffer bin) throws TException { int length = bin.limit() - bin.position(); writeBinary(bin.array(), bin.position() + bin.arrayOffset(), length); }
/** * Write a string to the wire with a varint size preceding. */ public void writeString(String str) throws TException { try { byte[] bytes = str.getBytes("UTF-8"); writeBinary(bytes, 0, bytes.length); } catch (UnsupportedEncodingException e) { throw new TException("UTF-8 not supported!"); } }
/** * Write a byte array, using a varint for the size. */ public void writeBinary(ByteBuffer bin) throws TException { int length = bin.limit() - bin.position() - bin.arrayOffset(); writeBinary(bin.array(), bin.position() + bin.arrayOffset(), length); }
/** * Write a byte array, using a varint for the size. */ public void writeBinary(ByteBuffer bin) throws TException { int length = bin.limit() - bin.position() - bin.arrayOffset(); writeBinary(bin.array(), bin.position() + bin.arrayOffset(), length); }
/** * Write a string to the wire with a varint size preceeding. */ public void writeString(String str) throws TException { try { byte[] bytes = str.getBytes("UTF-8"); writeBinary(bytes, 0, bytes.length); } catch (UnsupportedEncodingException e) { throw new TException("UTF-8 not supported!"); } }
/** * Write a string to the wire with a varint size preceeding. */ public void writeString(String str) throws TException { try { byte[] bytes = str.getBytes("UTF-8"); writeBinary(bytes, 0, bytes.length); } catch (UnsupportedEncodingException e) { throw new TException("UTF-8 not supported!"); } }
/** * Write a string to the wire with a varint size preceeding. */ public void writeString(String str) throws TException { try { writeBinary(str.getBytes("UTF-8")); } catch (UnsupportedEncodingException e) { throw new TException("UTF-8 not supported!"); } }