Constructor that uses the ByteData as buffer.
If isExpanding is true, buffer is expanded automatically.
isExpanding
RawWriter.withByteData(this._byteData, {this.isExpanding = true});