blob: 5adfc1e3302ba3a2b92bd5dd88e01f81a1d46f26 [file] [log] [blame] [view]
# claimBytes method
int claimBytes
(int size, int nextOutOfLineDepth)
## Implementation
```dart
int claimBytes(int size, int nextOutOfLineDepth) {
if (nextOutOfLineDepth > _maxOutOfLineDepth) {
throw FidlError('Exceeded maxOutOfLineDepth',
FidlErrorCode.fidlExceededMaxOutOfLineDepth);
}
final int result = _nextOffset;
_nextOffset += align(size);
if (_nextOffset > data.lengthInBytes) {
throw FidlError(
'Cannot access out of range memory', FidlErrorCode.fidlTooFewBytes);
}
return result;
}
```