@Override public void write(byte[] bytes) throws TTransportException { try { transport.write(bytes); } catch (TTransportException e) { throw rewriteException(e, address); } }
@Override public void write(byte[] bytes, int off, int len) throws TTransportException { try { transport.write(bytes, off, len); } catch (TTransportException e) { throw rewriteException(e, address); } }
@Override public void writeByte(byte b) throws TException { buf[0] = b; trans_.write(buf); }
@Override public void write(byte[] buf, int off, int len) throws TTransportException { wrapped.write(buf, off, len); }
@Override public void write(byte[] buf, int off, int len) throws TTransportException { wrapped.write(buf, off, len); }
@Override public void write(byte[] buf) throws TTransportException { wrapped.write(buf); }
@Override public void write(byte[] buf) throws TTransportException { wrapped.write(buf); }
private void writeRawBytes(byte[] bytes, int begin, int length) throws TException { if (ascending) { trans_.write(bytes, begin, length); } else { // For fields in descending order, do a bit flip first. if (rawBytesBuffer == null || rawBytesBuffer.length < bytes.length) { rawBytesBuffer = new byte[bytes.length]; } for (int i = begin; i < begin + length; i++) { rawBytesBuffer[i] = (byte) (~bytes[i]); } trans_.write(rawBytesBuffer, begin, length); } }
@Override public void flush() throws IOException { try { super.flush(); final byte[] bytes = toByteArray(); trans_.write(bytes); trans_.flush(); } catch (TTransportException ex) { throw new IOException(ex); } // Clears the internal memory buffer, since we've already // written it out. reset(); } }
out.writeI64(id); out.getTransport().write(bos.toByteArray()); out.getTransport().flush();
out.writeI64(id); out.getTransport().write(bos.toByteArray()); out.getTransport().flush();
@Override protected void write() throws TException { if (first_) { first_ = false; colon_ = true; } else { trans_.write(colon_ ? COLON : COMMA); colon_ = !colon_; } }
/** * Writes the buffer to the output * * @param buf The output data buffer * @throws TTransportException if an error occurs writing data */ public void write(byte[] buf) throws TTransportException { write(buf, 0, buf.length); }
protected void write() throws TException { if (first_) { first_ = false; colon_ = true; } else { trans_.write(colon_ ? COLON : COMMA); colon_ = !colon_; } } }
@Override public void write(final int b) throws IOException { try { transport.write(new byte[]{(byte) b}); } catch (TTransportException e) { throw new IOException(e); } }
public void _writeStringData(String s) throws TException { try { byte[] b = s.getBytes("UTF-8"); trans_.write(b); } catch (UnsupportedEncodingException uex) { throw new TException("JVM DOES NOT SUPPORT UTF-8"); } }
public void writeStructBegin(TStruct struct) throws TException { writeContext_.write(); trans_.write(LBRACE); pushWriteContext(new StructContext()); }
public void writeMapBegin(TMap map) throws TException { assertContextIsNotMapKey(MAP); writeContext_.write(); trans_.write(LBRACE); pushWriteContext(new MapContext()); // No metadata! }