func (cdb *Writer) Freeze() (*CDB, error) {
	var err error
	var header Header
	cdb.finalizeOnce.Do(func() {
		header, err = cdb.finalize()
	})

	if err != nil {
		return nil, err
	}

	if readerAt, ok := cdb.writer.(io.ReaderAt); ok {
		return &CDB{reader: readerAt, header: header, hasher: cdb.hasher}, nil
	} else {
		return nil, os.ErrInvalid
	}
}
// Freeze finalizes the database, then opens it for reads. If the stream cannot
// be converted to a io.ReaderAt, Freeze will return os.ErrInvalid.
//
// Close or Freeze must be called to finalize the database, or the resulting
// file will be invalid.
Freeze finalizes the database, then opens it for reads. If the stream cannot
be converted to a io.ReaderAt, Freeze will return os.ErrInvalid.

Close or Freeze must be called to finalize the database, or the resulting
file will be invalid.
// Freeze finalizes the database then opens it for reads . If the stream cannot // be converted to a io . ReaderAt Freeze will return os . ErrInvalid . // // Close or Freeze must be called to finalize the database or the resulting // file will be invalid .
func (cdb *Writer) Freeze() (*CDB, error) {
	var err error
	var header Header
	cdb.finalizeOnce.Do(func() {
		header, err = cdb.finalize()
	})
	if err != nil {
		return nil, err
	}
	if readerAt, ok := cdb.writer.(io.ReaderAt); ok {
		return &CDB{reader: readerAt, header: header, hasher: cdb.hasher}, nil
	} else {
		return nil, os.ErrInvalid
	}
}
func ( cdb * Writer ) Freeze ( ) ( * CDB , error ) { var err error var header Header cdb . finalizeOnce . Do ( func ( ) { header , err = cdb . finalize ( ) } ) if err != nil { return nil , err } if readerAt , ok := cdb . writer . ( io . ReaderAt ) ; ok { return & CDB { reader : readerAt , header : header , hasher : cdb . hasher } , nil } else { return nil , os . ErrInvalid } }
Freeze finalizes the database, then opens it for reads.
Freeze finalizes the database then opens it for reads .