code: public static boolean optMergeDelimitedFrom(InputStream in, 
              Object message, Schema schema, boolean drainRemainingBytesIfTooLarge, 
              LinkedBuffer buffer) throws IOException
      {
          if(buffer.start != buffer.offset)
              throw new IllegalArgumentException("Buffer previously used and had not been reset.");
          
          final int size = IOUtil.fillBufferWithDelimitedMessageFrom(in, 
                  drainRemainingBytesIfTooLarge, buffer);
          
          if(size == 0)
          {
              // empty message
              return true;
          }
          
          if(buffer.start == buffer.offset)
          {
              // read offset not set ... message too large
              return false;
          }
          
          final ByteArrayInput input = new ByteArrayInput(buffer.buffer, 
                  buffer.offset, size, false);
          try
          {
              schema.mergeFrom(input, message);
              input.checkLastTagWas(0);
          }
          catch(ArrayIndexOutOfBoundsException e)
          {
              throw ProtobufException.truncatedMessage(e);
          }
          finally
          {
              // reset
              buffer.offset = buffer.start;
          }
          
          return true;
      }
docs: Optimal/Optional mergeDelimitedFrom - If the message does not fit the buffer,
  no merge is done and this method will return false.
  
  This is strictly for reading a single message from the stream because the
  buffer is aggressively filled when reading the delimited size (which could
  result into reading more bytes than it has to).