static protected <T extends BaseMessage> T readGroup(CodedInputStream input, int tag, T group) throws IOException { group.mergeUnframed(input); input.checkLastTagWas(WireFormat.makeTag(tag, WireFormat.WIRETYPE_END_GROUP)); return group; }
public void writeUnframed(OutputStream output) throws IOException { CodedOutputStream codedOutput = new CodedOutputStream(output); writeUnframed(codedOutput); codedOutput.flush(); }
@Override public T mergeFramed(CodedInputStream input) throws IOException { int length = input.readRawVarint32(); int oldLimit = input.pushLimit(length); T rc = mergeUnframed(input.readRawBytes(length)); input.popLimit(oldLimit); return rc; }
public T mergeFramed(CodedInputStream input) throws IOException { int length = input.readRawVarint32(); int oldLimit = input.pushLimit(length); T rc = mergeUnframed(input); input.checkLastTagWas(0); input.popLimit(oldLimit); return rc; }
public void writeFramed(OutputStream output) throws IOException { CodedOutputStream codedOutput = new CodedOutputStream(output); writeFramed(codedOutput); codedOutput.flush(); }
public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { if( buffer !=null ) { return buffer; } return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); }
public T mergeUnframed(InputStream input) throws IOException { CodedInputStream codedInput = new CodedInputStream(input); mergeUnframed(codedInput); return getThis(); }
/** Encode and write a tag. */ public void writeTag(int fieldNumber, int wireType) throws IOException { writeRawVarint32(WireFormat.makeTag(fieldNumber, wireType)); }
/** Compute the number of bytes that would be needed to encode a tag. */ public static int computeTagSize(int fieldNumber) { return computeRawVarint32Size(WireFormat.makeTag(fieldNumber, 0)); }
public int serializedSizeFramed() { int t = serializedSizeUnframed(); return CodedOutputStream.computeRawVarint32Size(t) + t; }
public static void writeMessage(CodedOutputStream output, int tag, MessageBuffer message) throws IOException { output.writeTag(tag, WireFormat.WIRETYPE_LENGTH_DELIMITED); message.writeFramed(output); }
protected void loadAndClear() { super.loadAndClear(); load(); encodedForm = null; }
static protected void writeGroup(CodedOutputStream output, int tag, BaseMessage message) throws IOException { output.writeTag(tag, WireFormat.WIRETYPE_START_GROUP); message.writeUnframed(output); output.writeTag(tag, WireFormat.WIRETYPE_END_GROUP); }
/** * Converts this exception to an {@link InvalidProtocolBufferException}. * When a parsed message is missing required fields, this should be thrown * instead of {@code UninitializedMessageException}. */ public InvalidProtocolBufferException asInvalidProtocolBufferException() { return new InvalidProtocolBufferException(getMessage()); }
static protected void writeMessage(CodedOutputStream output, int tag, BaseMessage message) throws IOException { output.writeTag(tag, WireFormat.WIRETYPE_LENGTH_DELIMITED); message.writeFramed(output); }
/** Read a raw Varint from the stream. */ public long readRawVarint64() throws IOException { int shift = 0; long result = 0; while (shift < 64) { byte b = readRawByte(); result |= (long) (b & 0x7F) << shift; if ((b & 0x80) == 0) return result; shift += 7; } throw InvalidProtocolBufferException.malformedVarint(); }
public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { if( buffer !=null ) { return buffer; } return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); }
public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { if( buffer !=null ) { return buffer; } return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); }
public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { if( buffer !=null ) { return buffer; } return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); }
public org.fusesource.hawtbuf.Buffer toUnframedBuffer() { if( buffer !=null ) { return buffer; } return org.fusesource.hawtbuf.proto.MessageBufferSupport.toUnframedBuffer(this); }