open

fun open(segment: MemorySegment, offset: Long, length: Int, file: String): BitmapView

Opens the bitmap occupying [offset, offset + length) of segment.

The slice must be exactly one bitmap. That is what a sidecar records — a bitmap's bytes are encodedByteSize() long and its handle says so — and requiring it lets the structural pass confirm the blocks tile the slice, which catches truncation, a gap, an overlap and trailing bytes as one check rather than four.

Parameters

file

name of the file, carried into every failure this view can raise.

Throws

if the structure does not hold together.

if the version or a container kind is not known here.


fun open(encoded: ByteArray, file: String = "<memory>"): BitmapView

Opens a bitmap held on the heap — what ReadableBitmap.encode produces.