block 0.0.3 copy "block: ^0.0.3" to clipboard
block: ^0.0.3 copied to clipboard

A flexible and efficient binary data block handling library for Dart, supporting lazy loading, caching, and slicing of binary data.

0.0.3 #

Released: 2025-03-03

Bug Fixes #

  • Fix typo: renamed formStream method to fromStream for better API consistency

0.0.2 #

Released: 2025-03-03

Improve code comments

0.0.1 #

Released: 2025-03-02

Initial stable release of the Block package.

Features #

  • Core Block interface with efficient binary data handling
  • Multiple construction methods:
    • Block() - Create from builder function
    • Block.empty() - Create an empty block
    • Block.fromString() - Create from strings with encoding support
    • Block.fromBytes() - Create from existing Uint8List instances
    • Block.fromStream() - Create from byte streams
  • Data access methods:
    • size - Get block size in bytes
    • stream() - Access as a Stream
    • bytes() - Get all data as a single Uint8List
    • text() - Get data as UTF-8 decoded string
  • Slicing API with support for:
    • Positive and negative indices
    • Start and end positions
    • Efficient sub-range access without copying
  • Performance optimizations:
    • Lazy initialization
    • Result caching
    • Special handling for large blocks
    • Memory-efficient implementation
  • Comprehensive error handling and validation

Implementation Details #

  • Memory-efficient processing of binary data
  • Automatic caching of results for improved performance
  • UTF-8 decoding with fallback for malformed sequences
  • Proper resource management for stream-based blocks

This is the first stable release, providing a solid foundation for efficient binary data handling in Dart applications.

2
likes
150
points
69
downloads

Publisher

verified publishermedz.dev

Weekly Downloads

A flexible and efficient binary data block handling library for Dart, supporting lazy loading, caching, and slicing of binary data.

Repository (GitHub)
View/report issues

Topics

#binary #streams #data #blob #block

Documentation

API reference

License

MIT (license)

More

Packages that depend on block