/** Write an array of bytes. */ public void writeRawBytes(byte[] value) throws IOException { writeRawBytes(value, 0, value.length); }
/** Write a {@code string} field, including tag, to the stream. */ public void writeString(int fieldNumber, String value) throws IOException { writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); // Unfortunately there does not appear to be any way to tell Java to // encode // UTF-8 directly into our buffer, so we have to let it create its own // byte // array and then copy. byte[] bytes = value.getBytes("UTF-8"); writeRawVarint32(bytes.length); writeRawBytes(bytes); }
/** Write a {@code bytes} field, including tag, to the stream. */ public void writeBytes(int fieldNumber, Buffer value) throws IOException { writeTag(fieldNumber, WireFormat.WIRETYPE_LENGTH_DELIMITED); writeRawVarint32(value.length); writeRawBytes(value.data, value.offset, value.length); }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getCollectionKey()); output.writeBytes(2, bean.getEntryKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getCollectionKey()); output.writeBytes(2, bean.getEntryKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getCollectionKey()); output.writeBytes(2, bean.getEntryKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getCollectionKey()); output.writeBytes(2, bean.getEntryKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getCollectionKey()); output.writeBytes(2, bean.getEntryKey()); if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeBytes(1, bean.getKey()); if (bean.hasValue()) { output.writeBytes(2, bean.getValue()); } if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeBytes(1, bean.getKey()); if (bean.hasValue()) { output.writeBytes(2, bean.getValue()); } if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeBytes(1, bean.getKey()); if (bean.hasValue()) { output.writeBytes(2, bean.getValue()); } if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeBytes(1, bean.getKey()); if (bean.hasValue()) { output.writeBytes(2, bean.getValue()); } if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getKey()); if (bean.hasBindingKind()) { output.writeBytes(2, bean.getBindingKind()); } if (bean.hasBindingData()) { output.writeBytes(3, bean.getBindingData()); } if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } output.writeInt64(1, bean.getKey()); if (bean.hasBindingKind()) { output.writeBytes(2, bean.getBindingKind()); } if (bean.hasBindingData()) { output.writeBytes(3, bean.getBindingData()); } if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (buffer == null) { int size = serializedSizeUnframed(); buffer = output.getNextBuffer(size); org.fusesource.hawtbuf.proto.CodedOutputStream original=null; if( buffer == null ) { buffer = new org.fusesource.hawtbuf.Buffer(new byte[size]); original = output; output = new org.fusesource.hawtbuf.proto.CodedOutputStream(buffer); } if (bean.hasName()) { output.writeBytes(1, bean.getName()); } if (bean.hasQos()) { output.writeInt32(2, bean.getQos()); } if (bean.hasAddress()) { output.writeBytes(3, bean.getAddress()); } if( original !=null ) { output.checkNoSpaceLeft(); output = original; output.writeRawBytes(buffer); } } else { output.writeRawBytes(buffer); } }