Merge pull request #28 from parlough/misc/spelling-fixes

Minor spelling fixes
diff --git a/README.md b/README.md
index 8d5a334..4cef360 100644
--- a/README.md
+++ b/README.md
@@ -172,7 +172,7 @@
   The reader should never crash.
 - Reading a tar file can be cancelled mid-stream without leaking resources.
 
-However, the tar reader __does not__ throw exceptions for wellformed archives
+However, the tar reader __does not__ throw exceptions for well-formed archives
 with suspicious contents, such as
 
 - File names beginning with `../`, `/` or names pointing out of the archive by
diff --git a/lib/src/header.dart b/lib/src/header.dart
index e18cddf..f35130c 100644
--- a/lib/src/header.dart
+++ b/lib/src/header.dart
@@ -16,7 +16,7 @@
 enum TypeFlag {
   /// [reg] indicates regular files.
   ///
-  /// Old tar implementations have a seperate `TypeRegA` value. This library
+  /// Old tar implementations have a separate `TypeRegA` value. This library
   /// will transparently read those as [regA].
   reg,
 
@@ -59,7 +59,7 @@
   /// but does not currently support persisting the global state across files.
   xGlobalHeader,
 
-  /// Indiates a sparse file in the GNU format
+  /// Indicates a sparse file in the GNU format
   gnuSparse,
 
   /// Used by the GNU format for a meta file to store the path or link name for
diff --git a/lib/src/reader.dart b/lib/src/reader.dart
index c167151..3148a65 100644
--- a/lib/src/reader.dart
+++ b/lib/src/reader.dart
@@ -54,7 +54,7 @@
   /// encountered, [moveNext] will wait for further events on the stream. If
   /// further data is received, a [TarException] will be thrown and the
   /// subscription will be cancelled. Otherwise, [moveNext] effectively waits
-  /// for a done event, making a cancellation unecessary.
+  /// for a done event, making a cancellation unnecessary.
   /// Depending on the input stream, cancellations may cause unintended
   /// side-effects. In that case, [disallowTrailingData] can be used to ensure
   /// that the stream is only cancelled if it emits an invalid tar file.
@@ -87,7 +87,7 @@
   /// Reads the tar stream up until the beginning of the next logical file.
   ///
   /// If such file exists, the returned future will complete with `true`. After
-  /// the future completes, the next tar entry will be evailable in [current].
+  /// the future completes, the next tar entry will be available in [current].
   ///
   /// If no such file exists, the future will complete with `false`.
   /// The future might complete with an [TarException] if the tar stream is
@@ -295,7 +295,7 @@
             await cancel();
             rethrow;
           } finally {
-            // This also draines the stream
+            // This also drains the stream
             _currentStream = null;
           }
 
@@ -320,7 +320,7 @@
     return size;
   }
 
-  /// Ater we detected the end of a tar file, optionally check for trailing
+  /// After we detected the end of a tar file, optionally check for trailing
   /// data.
   Future<void> _handleExpectedEof() async {
     if (_checkNoTrailingData) {
diff --git a/lib/src/utils.dart b/lib/src/utils.dart
index 1c42cc6..bdb6435 100644
--- a/lib/src/utils.dart
+++ b/lib/src/utils.dart
@@ -249,7 +249,7 @@
   bool _isClosed = false;
 
   /// If a request is active, returns the current stream that we're reporting.
-  /// This controler is synchronous.
+  /// This controller is synchronous.
   StreamController<Uint8List>? _outgoing;
 
   /// The amount of (512-byte) blocks remaining before [_outgoing] should close.
@@ -275,7 +275,7 @@
   /// only interested in a small chunk.
   ///
   /// We will never have trailing data and a pending block at the same time.
-  /// When we haver fewer than 512 bytes of trailing data, it should be stored
+  /// When we have fewer than 512 bytes of trailing data, it should be stored
   /// as a pending block instead.
   Uint8List? _trailingData;
 
@@ -302,7 +302,7 @@
       _outgoing = null;
       _pause();
 
-      // Scheduling this in a microtask becuase the stream controller is
+      // Scheduling this in a microtask because the stream controller is
       // synchronous.
       scheduleMicrotask(() {
         // We don't need to await this since the stream controller is not used
@@ -403,11 +403,11 @@
 
     _isClosed = true;
 
-    // Can be unawated because this is an onDone callback of the subscription,
+    // Can be unawaited because this is an onDone callback of the subscription,
     // the subscription is already complete and we're just cleaning up.
     unawaited(_subscription?.cancel());
 
-    // Can be unawated because we're fully done here, we won't do anything else
+    // Can be unawaited because we're fully done here, we won't do anything else
     // with the outgoing controller.
     unawaited(outgoing.close());
   }
diff --git a/lib/src/writer.dart b/lib/src/writer.dart
index 24f9190..4856700 100644
--- a/lib/src/writer.dart
+++ b/lib/src/writer.dart
@@ -439,7 +439,7 @@
     final invalidOptions = values.keys.toSet()..removeAll(allowedKeys);
     if (invalidOptions.isNotEmpty) {
       throw UnsupportedError(
-        'Unsupporteed entry for OutputFormat.gnu. It uses long fields that '
+        'Unsupported entry for OutputFormat.gnu. It uses long fields that '
         "can't be represented: $invalidOptions. \n"
         'Try using OutputFormat.pax instead.',
       );
diff --git a/test/reader_test.dart b/test/reader_test.dart
index 11605b2..d1abde5 100644
--- a/test/reader_test.dart
+++ b/test/reader_test.dart
@@ -934,7 +934,7 @@
       });
     }
 
-    test('reader procudes an empty stream if the entry has no size', () async {
+    test('reader produces an empty stream if the entry has no size', () async {
       final reader = TarReader(open('trailing-slash.tar'));
       while (await reader.moveNext()) {
         expect(await reader.current.contents.toList(), isEmpty);
@@ -973,7 +973,7 @@
   });
 
   group('PAX headers', () {
-    test('locals overrwrite globals', () {
+    test('locals overwrite globals', () {
       final header = PaxHeaders()
         ..newGlobals({'foo': 'foo', 'bar': 'bar'})
         ..newLocals({'foo': 'local'});