Clean up dead code in System.IO* (dotnet/corefx#32654)
authorXander Hoogland <github@xanland.nl>
Sun, 7 Oct 2018 02:45:01 +0000 (04:45 +0200)
committerJan Kotas <jkotas@microsoft.com>
Sun, 7 Oct 2018 02:45:01 +0000 (19:45 -0700)
* Remove dead code from System.IO.Compression.Brotli.

* Remove dead code from System.IO.FileSystem.DriveInfo.

* Remove dead code from System.IO.Pipes.

Commit migrated from https://github.com/dotnet/corefx/commit/93ebee2ae64fbe4816ff4bf3bb19eb9ca174baf4

src/libraries/System.IO.Compression.Brotli/src/Resources/Strings.resx
src/libraries/System.IO.FileSystem.DriveInfo/src/System/IO/DriveInfo.cs
src/libraries/System.IO.Pipes/src/System/IO/Pipes/PipeStream.cs

index 19306ba..e8bd6e4 100644 (file)
   </data>
   <data name="Stream_FalseCanWrite" xml:space="preserve">
     <value>Stream does not support writing.</value>
-  </data>  
+  </data>
   <data name="ArgumentOutOfRange_Enum" xml:space="preserve">
     <value>Enum value was out of legal range.</value>
-  </data>  
+  </data>
   <data name="ObjectDisposed_StreamClosed" xml:space="preserve">
     <value>Cannot access a closed stream.</value>
-  </data>  
+  </data>
   <data name="ArgumentOutOfRange_NeedPosNum" xml:space="preserve">
     <value>Positive number required.</value>
-  </data>  
+  </data>
   <data name="InvalidArgumentOffsetCount" xml:space="preserve">
     <value>Offset plus count is larger than the length of target array.</value>
   </data>
   </data>
   <data name="BrotliEncoder_Disposed" xml:space="preserve">
     <value>Can not access a closed Encoder.</value>
-  </data>  
+  </data>
   <data name="BrotliEncoder_Quality" xml:space="preserve">
     <value>Provided BrotliEncoder Quality of {0} is not between the minimum value of {1} and the maximum value of {2}</value>
   </data>
   <data name="BrotliDecoder_Create" xml:space="preserve">
     <value>Failed to create BrotliDecoder instance</value>
   </data>
-  <data name="BrotliDecoder_Error" xml:space="preserve">
-    <value>Decoder threw unexpected error: {0}</value>
-  </data>
   <data name="BrotliDecoder_Disposed" xml:space="preserve">
     <value>Can not access a closed Decoder.</value>
-  </data>  
+  </data>
   <!-- BrotliStream.Compress -->
   <data name="BrotliStream_Compress_UnsupportedOperation" xml:space="preserve">
     <value>Can not perform Read operations on a BrotliStream constructed with CompressionMode.Compress.</value>
index 83a179b..d5fce24 100644 (file)
@@ -20,11 +20,6 @@ namespace System.IO
             _name = NormalizeDriveName(driveName);
         }
 
-        private DriveInfo(SerializationInfo info, StreamingContext context)
-        {
-            throw new PlatformNotSupportedException();
-        }
-
         void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
         {
             throw new PlatformNotSupportedException();
index 7aec0b0..4095d56 100644 (file)
@@ -340,16 +340,6 @@ namespace System.IO.Pipes
             Debug.Assert(!handle.IsClosed, "handle is closed");
         }
 
-        [Conditional("DEBUG")]
-        private static void DebugAssertReadWriteArgs(byte[] buffer, int offset, int count, SafePipeHandle handle)
-        {
-            Debug.Assert(buffer != null, "buffer is null");
-            Debug.Assert(offset >= 0, "offset is negative");
-            Debug.Assert(count >= 0, "count is negative");
-            Debug.Assert(offset <= buffer.Length - count, "offset + count is too big");
-            DebugAssertHandleValid(handle);
-        }
-
         // Reads a byte from the pipe stream.  Returns the byte cast to an int
         // or -1 if the connection has been broken.
         public override unsafe int ReadByte()