dart:convert
库中Base64Decoder
类的用法介绍如下。
base64 编码数据的解码器。
此解码器接受 base64 和 base64url ("url-safe") 编码。
编码需要正确填充。
如果输入不是有效的 base64 数据,则抛出 FormatException。
例子:
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
相关用法
- Dart Base64Encoder用法及代码示例
- Dart BigInt.toRadixString用法及代码示例
- Dart BigInt.operator_divide用法及代码示例
- Dart ByteData.view用法及代码示例
- Dart BigInt用法及代码示例
- Dart BigInt.from用法及代码示例
- Dart ByteData用法及代码示例
- Dart BigInt.isValidInt用法及代码示例
- Dart BigInt.toDouble用法及代码示例
- Dart BigInt.parse用法及代码示例
- Dart BigInt.bitLength用法及代码示例
- Dart BigInt.gcd用法及代码示例
- Dart BigInt.operator_truncate_divide用法及代码示例
- Dart BigInt.tryParse用法及代码示例
- Dart BigInt.compareTo用法及代码示例
- Dart BigInt.remainder用法及代码示例
- Dart BigInt.toInt用法及代码示例
- Dart BigInt.operator_modulo用法及代码示例
- Dart BigInt.toUnsigned用法及代码示例
- Dart BigInt.toString用法及代码示例
- Dart BigInt.pow用法及代码示例
- Dart BigInt.toSigned用法及代码示例
- Dart MapMixin.containsKey用法及代码示例
- Dart Iterator用法及代码示例
- Dart AttributeClassSet.intersection用法及代码示例
注:本文由纯净天空筛选整理自dart.dev大神的英文原创作品 Base64Decoder class。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。