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 int serializedSizeUnframed() { if (buffer != null) { return buffer.length; } if (size != -1) return size; size = 0; size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getCollectionKey()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(2, getEntryKey()); return size; }
public int serializedSizeFramed() { int t = serializedSizeUnframed(); return org.fusesource.hawtbuf.proto.CodedOutputStream.computeRawVarint32Size(t) + t; }
/** 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); }
/** * Compute the number of bytes that would be needed to encode an {@code * int32} field, including tag. */ public static int computeInt32Size(int fieldNumber, int value) { if (value >= 0) { return computeTagSize(fieldNumber) + computeRawVarint32Size(value); } else { // Must sign-extend. return computeTagSize(fieldNumber) + 10; } }
/** * Compute the number of bytes that would be needed to encode an {@code * sint32} field, including tag. */ public static int computeSInt32Size(int fieldNumber, int value) { return computeTagSize(fieldNumber) + computeRawVarint32Size(encodeZigZag32(value)); }
public int serializedSizeUnframed() { if (buffer != null) { return buffer.length; } if (size != -1) return size; size = 0; if (hasKey()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getKey()); } if (hasType()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(2, getType()); } if (hasMeta()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(3, getMeta()); } return size; }
public void writeFramed(java.io.OutputStream output) throws java.io.IOException { org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); writeFramed(codedOutput); codedOutput.flush(); }
size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getQueueKey()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(2, getQueueSeq()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(3, getMessageKey()); if (hasSize()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(4, getSize()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(5, getAttachment()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(6, getRedeliveries()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeSInt64Size(7, getExpiration()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(8, getMessageLocator()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(9, i);
public int serializedSizeUnframed() { if (buffer != null) { return buffer.length; } if (size != -1) return size; size = 0; if (hasName()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(1, getName()); } if (hasQos()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(2, getQos()); } if (hasAddress()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(3, getAddress()); } return size; }
public void writeFramed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { output.writeRawVarint32(serializedSizeUnframed()); writeUnframed(output); }
public int serializedSizeUnframed() { if (buffer != null) { return buffer.length; } if (size != -1) return size; size = 0; size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(1, getKey()); if (hasValue()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(2, getValue()); } return size; }
public void writeUnframed(org.fusesource.hawtbuf.proto.CodedOutputStream output) throws java.io.IOException { if (hasHashAlg()) { output.writeString(1, getHashAlg()); } if (hasHashBytes()) { output.writeBytes(2, getHashBytes()); } }
public int serializedSizeUnframed() { if (memoizedSerializedSize != -1) return memoizedSerializedSize; int size = 0; if (hasHashAlg()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeStringSize(1, getHashAlg()); } if (hasHashBytes()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(2, getHashBytes()); } memoizedSerializedSize = size; return size; }
/** Write an {@code int32} field, including tag, to the stream. */ public void writeInt32(int fieldNumber, int value) throws IOException { writeTag(fieldNumber, WireFormat.WIRETYPE_VARINT); if (value >= 0) { writeRawVarint32(value); } else { // Must sign-extend. writeRawVarint64(value); } }
/** Write an array of bytes. */ public void writeRawBytes(byte[] value) throws IOException { writeRawBytes(value, 0, value.length); }
public int serializedSizeUnframed() { if (buffer != null) { return buffer.length; } if (size != -1) return size; size = 0; if (hasKey()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getKey()); } if (hasType()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(2, getType()); } if (hasMeta()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(3, getMeta()); } return size; }
public void writeFramed(java.io.OutputStream output) throws java.io.IOException { org.fusesource.hawtbuf.proto.CodedOutputStream codedOutput = new org.fusesource.hawtbuf.proto.CodedOutputStream(output); writeFramed(codedOutput); codedOutput.flush(); }
size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(1, getQueueKey()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(2, getQueueSeq()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt64Size(3, getMessageKey()); if (hasSize()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(4, getSize()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(5, getAttachment()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(6, getRedeliveries()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeSInt64Size(7, getExpiration()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(8, getMessageLocator()); size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(9, i);
public int serializedSizeUnframed() { if (buffer != null) { return buffer.length; } if (size != -1) return size; size = 0; if (hasName()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(1, getName()); } if (hasQos()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeInt32Size(2, getQos()); } if (hasAddress()) { size += org.fusesource.hawtbuf.proto.CodedOutputStream.computeBytesSize(3, getAddress()); } return size; }