block 0.0.3
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
formStreammethod tofromStreamfor 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
Blockinterface with efficient binary data handling - Multiple construction methods:
Block()- Create from builder functionBlock.empty()- Create an empty blockBlock.fromString()- Create from strings with encoding supportBlock.fromBytes()- Create from existing Uint8List instancesBlock.fromStream()- Create from byte streams
- Data access methods:
size- Get block size in bytesstream()- Access as a Streambytes()- Get all data as a single Uint8Listtext()- 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.