class
Bakelite::Container::Reader
- Bakelite::Container::Reader
- Reference
- Object
Overview
Parses standalone .bkl archives, appended executable volumes, or in-memory container buffers. Reads the 32-byte trailer at the end of the container, validates all header/index bounds, and constructs StoredItems that stream chunks from the container source on demand.
Defined in:
bakelite/container/reader.crConstructors
- .from_bytes(bytes : Bytes, source_name : String = "<memory>") : self
- .from_io(io : IO, size : Int64 | Nil = nil, source_name : String = "<stream>") : self
- .new(target_path : Path | String)
- .new(bytes : Bytes, source_name : String = "<memory>")
- .new(io : IO, size : Int64 | Nil = nil, source_name : String = "<stream>")
Class Method Summary
-
.has_trailer?(file_path : Path | String) : Bool
Checks whether the target file contains a valid Bakelite volume trailer.
-
.has_trailer?(bytes : Bytes) : Bool
Checks whether an in-memory byte slice contains a valid Bakelite volume trailer.
-
.mount(registry : FS::Registry, archive_path : String | Path, volume_name : Symbol | String | Nil = nil, mount : String | Nil = nil, priority : Int32 = 0) : Volume | Nil
High-level helper to mount volumes from an archive file into a registry.
Instance Method Summary
-
#close : Nil
Closes the underlying container IO if owned by this Reader.
-
#read : Array(Volume)
Parses the container and returns all extracted volumes.
- #target_path : Path
- #trailer : Trailer | Nil
- #volumes : Array(Volume)
Constructor Detail
Class Method Detail
Checks whether the target file contains a valid Bakelite volume trailer.
Checks whether an in-memory byte slice contains a valid Bakelite volume trailer.
High-level helper to mount volumes from an archive file into a registry.