@Override public void mergeFrom(Input input, final Object message) throws IOException { final Schema<Object> schema = lastSchema; // merge using this input. schema.mergeFrom(this, message); if (!schema.isInitialized(message)) throw new UninitializedMessageException(message, schema); // restore lastSchema = schema; }
@Override public void mergeFrom(Input input, final Object message) throws IOException { final Schema<Object> schema = lastSchema; // merge using this input. schema.mergeFrom(this, message); if (!schema.isInitialized(message)) throw new UninitializedMessageException(message, schema); // restore lastSchema = schema; }
private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException { if (value == null) value = schema.newMessage(); schema.mergeFrom(this, value); if (!schema.isInitialized(value)) throw new UninitializedMessageException(value, schema); // handling is in #readFieldNumber checkLastTagWas(0); return value; }
private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException { if (value == null) value = schema.newMessage(); schema.mergeFrom(this, value); if (!schema.isInitialized(value)) throw new UninitializedMessageException(value, schema); // handling is in #readFieldNumber checkLastTagWas(0); return value; }
private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException { if (value == null) { value = schema.newMessage(); } schema.mergeFrom(this, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema); } // handling is in #readFieldNumber checkLastTagWas(0); return value; }
private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException { if (value == null) { value = schema.newMessage(); } schema.mergeFrom(this, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema); } // handling is in #readFieldNumber checkLastTagWas(0); return value; }
private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException { if (value == null) { value = schema.newMessage(); } schema.mergeFrom(this, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema); } // handling is in #readFieldNumber checkLastTagWas(0); return value; }
private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException { if (value == null) { value = schema.newMessage(); } schema.mergeFrom(this, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema); } // handling is in #readFieldNumber checkLastTagWas(0); return value; }
throw new UninitializedMessageException(value, schema);
@Override public <T> T mergeObject(T value, final Schema<T> schema) throws IOException { if (decodeNestedMessageAsGroup) return mergeObjectEncodedAsGroup(value, schema); final int length = readRawVarint32(); if (length < 0) throw ProtobufException.negativeSize(); if (buffer.remaining() < length) throw ProtobufException.misreportedSize(); ByteBuffer dup = buffer.slice(); dup.limit(length); // save old limit // final int oldLimit = this.limit; // this.limit = offset + length; if (value == null) value = schema.newMessage(); ByteBufferInput nestedInput = new ByteBufferInput(dup, decodeNestedMessageAsGroup); schema.mergeFrom(nestedInput, value); if (!schema.isInitialized(value)) throw new UninitializedMessageException(value, schema); nestedInput.checkLastTagWas(0); // checkLastTagWas(0); // restore old limit // this.limit = oldLimit; buffer.position(buffer.position() + length); return value; }
@Override public <T> T mergeObject(T value, final Schema<T> schema) throws IOException { if (decodeNestedMessageAsGroup) { return mergeObjectEncodedAsGroup(value, schema); } final int length = readRawVarInt32(); if (length < 0) { throw ProtocolException.negativeSize(); } if (nioBuffer.remaining() < length) { throw ProtocolException.misreportedSize(); } ByteBuffer dup = nioBuffer.slice(); dup.limit(length); if (value == null) { value = schema.newMessage(); } ByteBufferInput nestedInput = new ByteBufferInput(dup, false); schema.mergeFrom(nestedInput, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema); } nestedInput.checkLastTagWas(0); nioBuffer.position(nioBuffer.position() + length); return value; }
@Override public <T> T mergeObject(T value, final Schema<T> schema) throws IOException { if (decodeNestedMessageAsGroup) { return mergeObjectEncodedAsGroup(value, schema); } final int length = readRawVarInt32(); if (length < 0) { throw ProtocolException.negativeSize(); } if (nioBuffer.remaining() < length) { throw ProtocolException.misreportedSize(); } ByteBuffer dup = nioBuffer.slice(); dup.limit(length); if (value == null) { value = schema.newMessage(); } ByteBufferInput nestedInput = new ByteBufferInput(dup, false); schema.mergeFrom(nestedInput, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema); } nestedInput.checkLastTagWas(0); nioBuffer.position(nioBuffer.position() + length); return value; }
@Override public <T> T mergeObject(T value, final Schema<T> schema) throws IOException { emptyMessage = nextTag() == END_ELEMENT; if (value == null) value = schema.newMessage(); schema.mergeFrom(this, value); if (!schema.isInitialized(value)) throw new UninitializedMessageException(value, schema); // onto the next nextTag(); return value; }
schema.mergeFrom(nestedInput, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema);
schema.mergeFrom(nestedInput, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema);
/** * Reads a message field value from the stream (using the {@code group} encoding). */ private <T> T mergeObjectEncodedAsGroup(T value, final Schema<T> schema) throws IOException { // if (recursionDepth >= recursionLimit) { // throw ProtobufException.recursionLimitExceeded(); // } // ++recursionDepth; if (value == null) { value = schema.newMessage(); } schema.mergeFrom(this, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema); } // handling is in #readFieldNumber checkLastTagWas(0); // --recursionDepth; return value; }
@Override public <T> T mergeObject(T value, final Schema<T> schema) throws IOException { if (decodeNestedMessageAsGroup) return mergeObjectEncodedAsGroup(value, schema); final int length = readRawVarint32(); if (length < 0) throw ProtobufException.negativeSize(); // save old limit final int oldLimit = this.limit; this.limit = offset + length; if (value == null) value = schema.newMessage(); schema.mergeFrom(this, value); if (!schema.isInitialized(value)) throw new UninitializedMessageException(value, schema); checkLastTagWas(0); // restore old limit this.limit = oldLimit; return value; }
throw new UninitializedMessageException(message, schema);
@Override public <T> T mergeObject(T value, final Schema<T> schema) throws IOException { if (decodeNestedMessageAsGroup) return mergeObjectEncodedAsGroup(value, schema); final int length = readRawVarint32(); // if (recursionDepth >= recursionLimit) { // throw ProtobufException.recursionLimitExceeded(); // } final int oldLimit = pushLimit(length); // ++recursionDepth; if (value == null) { value = schema.newMessage(); } schema.mergeFrom(this, value); if (!schema.isInitialized(value)) { throw new UninitializedMessageException(value, schema); } checkLastTagWas(0); // --recursionDepth; popLimit(oldLimit); return value; }
throw new UninitializedMessageException(message, schema);