def write_object(id, raw)
      if @entries.length > @btreedb.max_blob_size
        # The blob has reached the maximum size. Replace the blob with a BTree
        # node directory and distribute the blob entires into the sub-blobs of
        # the new BTree node.
        split_blob
        # Insert the passed object into the newly created BTree node.
        @btreedb.put_raw_object(raw, id)
      else
        bytes = raw.bytesize
        crc32 = Zlib.crc32(raw, 0)
        start_address = reserve_bytes(id, bytes, crc32)
        if write_to_blobs_file(raw, start_address) != bytes
          PEROBS.log.fatal 'Object length does not match written bytes'
        end
        write_index
      end
    end
def write_object(id, raw)
      if @entries.length > @btreedb.max_blob_size
        # The blob has reached the maximum size. Replace the blob with a BTree
        # node directory and distribute the blob entires into the sub-blobs of
        # the new BTree node.
        split_blob
        # Insert the passed object into the newly created BTree node.
        @btreedb.put_raw_object(raw, id)
      else
        bytes = raw.bytesize
        crc32 = Zlib.crc32(raw, 0)
        start_address = reserve_bytes(id, bytes, crc32)
        if write_to_blobs_file(raw, start_address) != bytes
          PEROBS.log.fatal 'Object length does not match written bytes'
        end
        write_index
      end
    end
Create a new BTreeBlob object.
 @param dir [String] Fully qualified directory name
 @param btreedb [BTreeDB] Reference to the DB that owns this blob
 Write the given bytes with the given ID into the DB.
 @param id [Integer] ID
 @param raw [String] sequence of bytes