unsafe library

Unsafe / advanced APIs.

Import this entrypoint only if you understand the lifetime rules.

  • Borrowed frame views may reference internal buffers owned by a driver.
  • Borrowed views are only valid during the callback that receives them.
  • If you need to retain bytes, copy via toOwnedBytes() inside the callback.
  • The library can fail-fast when you use the FrameBorrowedView object outside the callback, but it cannot reliably detect retention of derived Uint8List views.

Classes

BorrowedBytesCodec
Optional interface for codecs that can provide a zero-copy (borrowed) view over decoded frame bytes.
FrameBorrowedView
A short-lived view over decoded frame bytes.
FramerBorrowedBytes
Incremental framing driver that delivers frames as FrameBorrowedView.

Extensions

UnsafeFramingX on Stream<List<int>>