class Bakelite::Container::Reader

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.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.from_bytes(bytes : Bytes, source_name : String = "<memory>") : self #

[View source]
def self.from_io(io : IO, size : Int64 | Nil = nil, source_name : String = "<stream>") : self #

[View source]
def self.new(target_path : Path | String) #

[View source]
def self.new(bytes : Bytes, source_name : String = "<memory>") #

[View source]
def self.new(io : IO, size : Int64 | Nil = nil, source_name : String = "<stream>") #

[View source]

Class Method Detail

def self.has_trailer?(file_path : Path | String) : Bool #

Checks whether the target file contains a valid Bakelite volume trailer.


[View source]
def self.has_trailer?(bytes : Bytes) : Bool #

Checks whether an in-memory byte slice contains a valid Bakelite volume trailer.


[View source]
def self.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.


[View source]

Instance Method Detail

def close : Nil #

Closes the underlying container IO if owned by this Reader.


[View source]
def read : Array(Volume) #

Parses the container and returns all extracted volumes.


[View source]
def target_path : Path #

[View source]
def trailer : Trailer | Nil #

[View source]
def volumes : Array(Volume) #

[View source]