code: static int mergeDelimitedFrom(InputStream in, byte[] buf, Object message, 
              Schema schema, boolean decodeNestedMessageAsGroup) throws IOException
      {
          final int size = in.read();
          if(size == -1)
              throw new EOFException("mergeDelimitedFrom");
          
          final int len = size < 0x80 ? size : CodedInput.readRawVarint32(in, size);
          
          if(len < 0)
              throw ProtobufException.negativeSize();
          
          if(len != 0)
          {
              // not an empty message
              if(len > buf.length)
              {
                  // size limit exceeded.
                  throw new ProtobufException("size limit exceeded. " + 
                          len + " > " + buf.length);
              }
              
              fillBufferFrom(in, 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);
          }
          
          return len;
      }
docs: The {@code buf} size limits the size of the message that must be read.
  A ProtobufException (sizeLimitExceeded) will be thrown if the
  size of the delimited message is larger.