static int mergeDelimitedFrom(DataInput in, Object message, Schema schema, 
            boolean decodeNestedMessageAsGroup) throws IOException
    {
        final byte size = in.readByte();
        final int len = 0 == (size & 0x80) ? size : CodedInput.readRawVarint32(in, size);
        
        if(len < 0)
            throw ProtobufException.negativeSize();
        
        if(len != 0)
        {
            // not an empty message
            if(len > CodedInput.DEFAULT_BUFFER_SIZE && in instanceof InputStream)
            {
                // message too big
                final CodedInput input = new CodedInput(new LimitedInputStream((InputStream)in, len), 
                        decodeNestedMessageAsGroup);
                schema.mergeFrom(input, message);
                input.checkLastTagWas(0);
            }
            else
            {
                final byte[] buf = new byte[len];
                in.readFully(buf, 0, len);
                final ByteArrayInput input = new ByteArrayInput(buf, 0, len, 
                        decodeNestedMessageAsGroup);
                try
                {
                    schema.mergeFrom(input, message);
                }
                catch(ArrayIndexOutOfBoundsException e)
                {
                    throw ProtobufException.truncatedMessage(e);
                }
                input.checkLastTagWas(0);
            }
        }

        // check it since this message is embedded in the DataInput.
        if(!schema.isInitialized(message))
            throw new UninitializedMessageException(message, schema);
        
        return len;
    }
static int mergeDelimitedFrom ( DataInput in , Object message , Schema schema , boolean decodeNestedMessageAsGroup ) throws IOException { final byte size = in . readByte ( ) ; final int len = 0 == ( size & 0x80 ) ? size : CodedInput . readRawVarint32 ( in , size ) ; if ( len < 0 ) throw ProtobufException . negativeSize ( ) ; if ( len != 0 ) { if ( len > CodedInput . DEFAULT_BUFFER_SIZE && in instanceof InputStream ) { final CodedInput input = new CodedInput ( new LimitedInputStream ( ( InputStream ) in , len ) , decodeNestedMessageAsGroup ) ; schema . mergeFrom ( input , message ) ; input . checkLastTagWas ( 0 ) ; } else { final byte [ ] buf = new byte [ len ] ; in . readFully ( buf , 0 , len ) ; final ByteArrayInput input = new ByteArrayInput ( buf , 0 , len , decodeNestedMessageAsGroup ) ; try { schema . mergeFrom ( input , message ) ; } catch ( ArrayIndexOutOfBoundsException e ) { throw ProtobufException . truncatedMessage ( e ) ; } input . checkLastTagWas ( 0 ) ; } } if ( ! schema . isInitialized ( message ) ) throw new UninitializedMessageException ( message , schema ) ; return len ; }
Used by the code generated messages that implement {@link java.io.Externalizable}.
Merges from the {@link DataInput}.