| Index: pkg/mime/lib/src/magic_number.dart
|
| diff --git a/pkg/mime/lib/src/magic_number.dart b/pkg/mime/lib/src/magic_number.dart
|
| index 1229b6dab5fac94fd2b701c06fb440c0db2a421e..6c554aaa4e2fcfa9c2f0d48f55953e6fa9ec845e 100644
|
| --- a/pkg/mime/lib/src/magic_number.dart
|
| +++ b/pkg/mime/lib/src/magic_number.dart
|
| @@ -2,15 +2,14 @@
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -part of mime;
|
| +library mime.magic_number;
|
|
|
| -
|
| -class _MagicNumber {
|
| +class MagicNumber {
|
| final String mimeType;
|
| final List<int> numbers;
|
| final List<int> mask;
|
|
|
| - const _MagicNumber(this.mimeType, this.numbers, {this.mask});
|
| + const MagicNumber(this.mimeType, this.numbers, {this.mask});
|
|
|
| bool matches(List<int> header) {
|
| if (header.length < numbers.length) return false;
|
| @@ -28,19 +27,17 @@ class _MagicNumber {
|
|
|
| }
|
|
|
| -const int _DEFAULT_MAGIC_NUMBERS_MAX_LENGTH = 16;
|
| -
|
| -const List<_MagicNumber> _DEFAULT_MAGIC_NUMBERS = const [
|
| - const _MagicNumber('application/pdf', const [0x25, 0x50, 0x44, 0x46]),
|
| - const _MagicNumber('application/postscript', const [0x25, 0x51]),
|
| - const _MagicNumber('image/gif', const [0x47, 0x49, 0x46, 0x38, 0x37, 0x61]),
|
| - const _MagicNumber('image/gif', const [0x47, 0x49, 0x46, 0x38, 0x39, 0x61]),
|
| - const _MagicNumber('image/jpeg', const [0xFF, 0xD8]),
|
| - const _MagicNumber('image/png',
|
| +const List<MagicNumber> DEFAULT_MAGIC_NUMBERS = const [
|
| + const MagicNumber('application/pdf', const [0x25, 0x50, 0x44, 0x46]),
|
| + const MagicNumber('application/postscript', const [0x25, 0x51]),
|
| + const MagicNumber('image/gif', const [0x47, 0x49, 0x46, 0x38, 0x37, 0x61]),
|
| + const MagicNumber('image/gif', const [0x47, 0x49, 0x46, 0x38, 0x39, 0x61]),
|
| + const MagicNumber('image/jpeg', const [0xFF, 0xD8]),
|
| + const MagicNumber('image/png',
|
| const [0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A]),
|
| - const _MagicNumber('image/tiff', const [0x49, 0x49, 0x2A, 0x00]),
|
| - const _MagicNumber('image/tiff', const [0x4D, 0x4D, 0x00, 0x2A]),
|
| - const _MagicNumber(
|
| + const MagicNumber('image/tiff', const [0x49, 0x49, 0x2A, 0x00]),
|
| + const MagicNumber('image/tiff', const [0x4D, 0x4D, 0x00, 0x2A]),
|
| + const MagicNumber(
|
| 'video/mp4',
|
| const [0x00, 0x00, 0x00, 0x00, 0x66, 0x74,
|
| 0x79, 0x70, 0x33, 0x67, 0x70, 0x35],
|
|
|