Function readFileBlock

Decode one complete PBF file block from cursor.

FrameReadResult readFileBlock(
  ref WireCursor cursor,
  ulong sequence,
  out FileBlockView block,
  out PbfStatus status
) nothrow @nogc @safe;

Parameters

NameDescription
cursor Cursor over the remaining PBF file bytes.
sequence Sequence number to attach to the returned block view.
block Receives the borrowed block view on success.
status Receives success or the framing failure.

Returns

FrameReadResult.block for one decoded block, FrameReadResult.endOfInput when called exactly at clean EOF, or FrameReadResult.error for malformed/truncated input.

Notes

On error the caller's cursor is not advanced. On success it advances by exactly block.encodedSize bytes. No memory is allocated.