BytesFileIO class
BytesIO implementation over RandomAccessFile.
Constructors
- BytesFileIO(RandomAccessFile io, {int? length})
- BytesFileIO.fromFile(File file, {int? length, bool append = true})
-
factory
Properties
- bytesData ↔ FileDataIntCodec
-
The internal ByteData to write integers and doubles.
latefinaloverride-getter
- capacity → int
-
Returns the size of the internal bytes buffer (Uint8List).
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
Returns
true
if this IO was closed.no setteroverride - isEmpty → bool
-
Returns
true
ifthis
instance is empty.no setterinherited - isNotEmpty → bool
-
Returns
true
ifthis
instance is NOT empty.no setterinherited - length → int
-
The length of bytes in this buffer.
no setteroverride
- position → int
-
The current read/write cursor position in the bytes buffer.
no setteroverride
- randomAccessFile → RandomAccessFile
-
The RandomAccessFile of this IO.
no setter
- remaining → int
-
The remaining bytes to read from position to the end of the buffer.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- supportsClosing → bool
-
Returns
true
on BytesFileIO implementation.no setteroverride
Methods
-
asUint8List(
[int offset = 0, int? length]) → Uint8List -
Returns
this
instance as a Uint8List. Returns the internalbytes
buffer if thelength
and capacity is the same, otherwise creates a copy with the exactlength
.override -
bytesTo<
R> (R output(Uint8List bytes, int offset, int length), [int offset = 0, int? length]) → R -
Calls the function
output
with the internal bytes of this instance.override -
canRead(
int length) → bool -
Returns
true
if at the current position it's possible to readlength
bytes.inherited -
checkCanRead(
int length) → void -
Checks if at the current position it's possible to read
length
bytes.inherited -
close(
) → dynamic -
Flushes then closes this instance.
override
-
compact(
) → bool -
Compact the internal bytes capacity to length.
override
-
ensureCapacity(
int needed) → void -
Ensures that capacity can store the
needed
bytes.override -
flush(
) → void -
Flushes this instance data.
override
-
incrementPosition(
int n) → void -
Increments position in
n
bytes.override -
indexOf(
int byte, [int offset = 0, int? length]) → int -
Returns the index of
byte
infoffset
andlength
range.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readByte(
) → int -
Reads 1 byte. Increments position by 1.
override
-
readBytes(
int length) → Uint8List -
Reads an Uint8List of
length
.override -
readTo(
BytesIO io, [int? length]) → int -
Read
length
bytes intoio
.override -
reset(
) → void -
Resets this buffer. Sets the length and position to
0
.override -
seek(
int position) → int -
Changes the read/write cursor
position
.override -
setLength(
int length) → void -
Sets the
length
of this buffer. Increases internal bytes buffer capacity if needed.override -
toBytes(
[int offset = 0, int? length]) → Uint8List -
Returns a copy of the internal bytes (Uint8List) of
this
instance.override -
toString(
) → String -
A string representation of this object.
override
-
write(
List< int> list, [int offset = 0, int? length]) → int -
Writes the
int
atlist
as bytes, respectingoffset
andlength
parameters.override -
writeAll(
List< int> list) → int -
Writes all the
int
atlist
as bytes.override -
writeAllBytes(
Uint8List bytes) → int -
Writes all the
bytes
into this buffer.override -
writeByte(
int b) → int -
Writes 1 byte. Increments position by 1.
override
-
writeBytes(
Uint8List bs, [int offset = 0, int? length]) → int -
Writes the
bytes
into this buffer, respectingoffset
andlength
parameters.override -
writeFrom(
BytesIO io, [int? length]) → int -
Writes
length
bytes fromio
.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
fromFileAsync(
File file, {int? length, bool append = true}) → Future< BytesFileIO>