code: public static int optWriteDelimitedTo(OutputStream out, Object message, 
              Schema schema, LinkedBuffer buffer) throws IOException
      {
          if(buffer.start != buffer.offset)
              throw new IllegalArgumentException("Buffer previously used and had not been reset.");
          
          final ProtobufOutput output = new ProtobufOutput(buffer);
          
          // leave space for varint32
          buffer.offset = buffer.start + 5;
          output.size += 5;
          
          schema.writeTo(output, message);
          
          final int size = output.size - 5;
          
          final int delimOffset = IOUtil.putVarInt32AndGetOffset(size, buffer.buffer, 
                  buffer.start);
          
          // write to stream
          out.write(buffer.buffer, delimOffset, buffer.offset - delimOffset);
          
          // flush remaining
          if(buffer.next != null)
              LinkedBuffer.writeTo(out, buffer.next);
          
          return size;
      }
docs: Optimal writeDelimitedTo - The varint32 prefix is written to the buffer instead
  of directly writing to outputstream.
  
  @return the size of the message