class
Bakelite::StoredItem
- Bakelite::StoredItem
- Bakelite::Item
- Reference
- Object
Overview
Chunked, compressed, and stream-backed asset (Store mode). Employs Bakelite::FileIO to stream chunks on demand in O(chunk_size) RAM.
Defined in:
bakelite/item.crConstructors
Instance Method Summary
- #chunks : Array(Chunk)
- #compression : CompressionType
-
#open : IO
Opens a readable stream for this asset.
-
#to_s(io : IO) : Nil
Streams the content into the given output IO.
-
#to_slice : Bytes
Returns the full contents as a byte slice.
- #underlying_io : IO | Nil
Instance methods inherited from class Bakelite::Item
compressed_size : Int64
compressed_size,
content : String
content,
crc32 : UInt32
crc32,
crc32_hex : String
crc32_hex,
etag : String
etag,
extract(target_path : Path | String, overwrite : Bool = true) : Bool
extract,
mime_type : String
mime_type,
open : IOopen(&block : IO -> T) : T forall T open, path : String path, size : Int64 size, storage_mode : StorageMode storage_mode, to_s(io : IO) : Nil
to_s : String to_s, to_slice : Bytes to_slice, volume_name : String volume_name
Constructor methods inherited from class Bakelite::Item
new(path : String, volume_name : Symbol | String, size : Int64, compressed_size : Int64, mime_type : String, crc32 : UInt32, storage_mode : StorageMode)
new
Constructor Detail
def self.new(path : String, volume_name : Symbol | String, size : Int64, compressed_size : Int64, chunks : Array(Chunk), compression : CompressionType = CompressionType::None, mime_type : String | Nil = nil, crc32 : UInt32 = 0_u32, underlying_io : IO | Nil = nil)
#
Instance Method Detail
def open : IO
#
Description copied from class Bakelite::Item
Opens a readable stream for this asset.
def to_s(io : IO) : Nil
#
Description copied from class Bakelite::Item
Streams the content into the given output IO.
def to_slice : Bytes
#
Description copied from class Bakelite::Item
Returns the full contents as a byte slice.