Decodes bytes according to contentType.

See HTTPRequestBody for a concrete implementation.

Implemented by

Constructors

HTTPBodyDecoder(Stream<List<int>> bytes)

Properties

bytes → Stream<List<int>>

The stream of bytes to decode.

final
contentType → ContentType

Determines how bytes get decoded.

read-only
decodedData → Future<List>

Returns decoded data, decoding it if not already decoded.

read-only
decodedType → Type

The type of data bytes was decoded into.

read-only
hasBeenDecoded → bool

Whether or not bytes have been decoded yet.

read-only
isEmpty → bool

Whether or not bytes is empty.

read-only
retainOriginalBytes → bool

Whether or not bytes are available as a list after decoding has occurred.

read / write
hashCode → int

The hash code for this object.

read-only, inherited
runtimeType → Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) → bool

The equality operator.

inherited

Methods

asBytes() → List<int>

Returns decoded data as a List of bytes if decoding has already been attempted.

asList() → List

Returns decoded data as List if decoding has already occurred.

asMap() → Map<String, dynamic>

Returns decoded data as Map if decoding has already occurred.

asString() → String

Returns decoded data as String if decoding as already occurred.

decodeAsBytes() → Future<List<int>>

Returns request body as List of bytes.

decodeAsList() → Future<List<Map<String, dynamic>>>

Returns decoded data as List, decoding it if not already decoded.

decodeAsMap() → Future<Map<String, dynamic>>

Returns decoded data as Map, decoding it if not already decoded.

decodeAsString() → Future<String>

Returns decoded data as String, decoding it if not already decoded.

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() → String

Returns a string representation of this object.

inherited