def write(content, type = :blob)
      if content.kind_of? MultiGit::Builder
        return content >> self
      end
      validate_type(type)
      if content.kind_of? MultiGit::Object
        if include?(content.oid)
          return read(content.oid)
        end
        content = content.to_io
      end
      use_inserter do |inserter|
        begin
          t_id = OBJECT_TYPE_IDS[type]
          reader = nil
          if content.respond_to? :path
            path = content.path
            reader = Java::JavaIO::FileInputStream.new(path)
            oid = inserter.insert(t_id.to_java(:int), ::File.size(content.path).to_java(:long), reader)
          else
            content = content.read if content.respond_to? :read
            oid = inserter.insert(t_id, content.bytes.to_a.to_java(:byte))
          end
          return OBJECT_CLASSES[type].new(self, oid)
        ensure
          reader.close if reader
        end
      end
    end
def write(content, type = :blob)
      if content.kind_of? MultiGit::Builder
        return content >> self
      end
      validate_type(type)
      if content.kind_of? MultiGit::Object
        if include?(content.oid)
          return read(content.oid)
        end
        content = content.to_io
      end
      use_inserter do |inserter|
        begin
          t_id = OBJECT_TYPE_IDS[type]
          reader = nil
          if content.respond_to? :path
            path = content.path
            reader = Java::JavaIO::FileInputStream.new(path)
            oid = inserter.insert(t_id.to_java(:int), ::File.size(content.path).to_java(:long), reader)
          else
            content = content.read if content.respond_to? :read
            oid = inserter.insert(t_id, content.bytes.to_a.to_java(:byte))
          end
          return OBJECT_CLASSES[type].new(self, oid)
        ensure
          reader.close if reader
        end
      end
    end
{include:MultiGit::Repository#write}
 @param (see MultiGit::Repository#write)
 @raise (see MultiGit::Repository#write)
 @return (see MultiGit::Repository#write)