FileBuffer constructor
FileBuffer(
- AbstractFileHandle _file, {
- int byteOrder = LITTLE_ENDIAN,
- int bufferSize = kDefaultBufferSize,
Implementation
FileBuffer(
this._file, {
this.byteOrder = LITTLE_ENDIAN,
int bufferSize = kDefaultBufferSize,
}) {
_fileSize = _file.length;
// Prevent having a buffer smaller than the minimum buffer size
_bufferSize = max(
// If possible, avoid having a buffer bigger than the file itself
min(bufferSize, _fileSize),
kMinBufferSize,
);
_buffer = Uint8List(_bufferSize);
_readBuffer(0, _fileSize);
}