# System.IO

``` diff
 namespace System.IO {
     public class DirectoryNotFoundException : IOException {
-        protected DirectoryNotFoundException(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected DirectoryNotFoundException(SerializationInfo info, StreamingContext context);
     }
     public class DriveNotFoundException : IOException {
-        protected DriveNotFoundException(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected DriveNotFoundException(SerializationInfo info, StreamingContext context);
     }
     public class EndOfStreamException : IOException {
-        protected EndOfStreamException(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected EndOfStreamException(SerializationInfo info, StreamingContext context);
     }
     [FlagsAttribute]
     public enum FileAttributes {
+        None = 0,
     }
     public class FileLoadException : IOException {
-        protected FileLoadException(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected FileLoadException(SerializationInfo info, StreamingContext context);
-        public override void GetObjectData(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        public override void GetObjectData(SerializationInfo info, StreamingContext context);
     }
     public class FileNotFoundException : IOException {
-        protected FileNotFoundException(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected FileNotFoundException(SerializationInfo info, StreamingContext context);
-        public override void GetObjectData(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        public override void GetObjectData(SerializationInfo info, StreamingContext context);
     }
     public abstract class FileSystemInfo : MarshalByRefObject, ISerializable {
-        protected FileSystemInfo(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected FileSystemInfo(SerializationInfo info, StreamingContext context);
-        public virtual void GetObjectData(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        public virtual void GetObjectData(SerializationInfo info, StreamingContext context);
     }
     public class InternalBufferOverflowException : SystemException {
-        protected InternalBufferOverflowException(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected InternalBufferOverflowException(SerializationInfo info, StreamingContext context);
     }
     public class IOException : SystemException {
-        protected IOException(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected IOException(SerializationInfo info, StreamingContext context);
     }
     public static class Path {
-        public static bool EndsInDirectorySeparator(string path);
+        public static bool EndsInDirectorySeparator([NotNullWhenAttribute(true)] string? path);
     }
     public class PathTooLongException : IOException {
-        protected PathTooLongException(SerializationInfo info, StreamingContext context);
+        [EditorBrowsableAttribute(EditorBrowsableState.Never)]
+        [ObsoleteAttribute("This API supports obsolete formatter-based serialization. It should not be called or extended by application code.", DiagnosticId="SYSLIB0051", UrlFormat="https://aka.ms/dotnet-warnings/{0}")]
+        protected PathTooLongException(SerializationInfo info, StreamingContext context);
     }
     public static class RandomAccess {
+        public static void FlushToDisk(SafeFileHandle handle);
     }
     public class StreamWriter : TextWriter {
+        public override Task FlushAsync(CancellationToken cancellationToken);
     }
     public abstract class TextWriter : MarshalByRefObject, IAsyncDisposable, IDisposable {
+        public virtual Task FlushAsync(CancellationToken cancellationToken);
     }
 }
```

