Base64Decoder class
Decoder for base64 encoded data.
This decoder accepts both base64 and base64url ("url-safe") encodings.
The encoding is required to be properly padded.
Throws a FormatException if the input is not valid base64 data.
Example:
final base64Decoder = base64.decoder; const base64Bytes = 'RGFydCBpcyBvcGVuIHNvdXJjZQ=='; final decodedBytes = base64Decoder.convert(base64Bytes); // decodedBytes: [68, 97, 114, 116, 32, 105, 115, 32, 111, 112, 101, 110, // 32, 115, 111, 117, 114, 99, 101] // Print as string using UTF-8 decoder print(utf8.decode(decodedBytes)); // Dart is open source
- Inheritance
Constructors
- Base64Decoder() const
Properties
- hashCode → int read-only, inherited
- The hash code for this object.
- runtimeType → Type read-only, inherited
- A representation of the runtime type of the object.
Methods
- bind(
Stream< String> stream) → Stream<List< int> >inherited - Transforms the provided
stream. - cast<
RS, RT> () → Converter< RS, RT> inherited - Provides a
Converter<RS, RT>view of this stream transformer. - convert(
String input, [int start = 0, int? end]) → Uint8List override - Decodes the characters of
inputfromstarttoendas base64. - fuse<
TT> (Converter< List< other) → Converter<int> , TT>String, TT> inherited - Fuses
thiswithother. - noSuchMethod(
Invocation invocation) → dynamic inherited - Invoked when a non-existent method or property is accessed.
- startChunkedConversion(
Sink< List< sink) → StringConversionSinkint> >override - Starts a chunked conversion.
- toString(
) → String inherited - A string representation of this object.
Operators
- operator ==(
Object other) → bool inherited - The equality operator.
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-convert/Base64Decoder-class.html