Skip to content

Commit 26d9ad5

Browse files
committed
Add range checking method to BinaryWriter for input validation
1 parent f3a0015 commit 26d9ad5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/src/binary_writer.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ class BinaryWriter extends BinaryWriterInterface {
344344
_capacity = size;
345345
}
346346

347+
/// Checks if the [value] is within the specified [min] and [max] range.
348+
///
349+
/// Throws a [RangeError] if the value is out of bounds.
347350
@pragma('vm:prefer-inline')
348351
@pragma('dart2js:tryInline')
349352
void _checkRange(int value, int min, int max, String typeName) {

0 commit comments

Comments
 (0)