main/Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.1
Created
February 27, 2022 13:54
-
-
Save smdn/761346264e1a7a12e8cdd65bac211501 to your computer and use it in GitHub Desktop.
Smdn.Fundamental.Stream.BinaryReaderWriter 3.0.1 Release Notes
- 2022-02-20 update assembly version
- 2022-02-04 suppress warning CA1051
- 2022-02-04 make sure to call GC.SuppressFinalize
- 2022-01-02 define PackageTags
- 2022-01-02 refactor assembly attributes and package properties
- 2021-12-12 add title for rule ID
- 2021-12-12 enable package validation and define PackageValidationBaselineVersion
- 2021-12-11 use file-scoped namespace declaration
- 2021-12-11 modernize codes
- 2021-12-10 fix spacing
- 2021-12-10 disable code style formatting
- 2021-12-10 add comment
- 2021-12-10 follow the code analyzer rules
- 2021-12-09 tune up .editorconfig and analyzer rule sets
- 2021-12-05 modify to follow the code style rules
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-net45.apilist.cs b/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-net45.apilist.cs | |
index eb50c029..02a2377a 100644 | |
--- a/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-net45.apilist.cs | |
+++ b/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-net45.apilist.cs | |
@@ -1,269 +1,269 @@ | |
-// Smdn.Fundamental.Stream.BinaryReaderWriter.dll (Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.0 (net45)) | |
+// Smdn.Fundamental.Stream.BinaryReaderWriter.dll (Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.1) | |
// Name: Smdn.Fundamental.Stream.BinaryReaderWriter | |
-// AssemblyVersion: 3.0.0.0 | |
-// InformationalVersion: 3.0.0 (net45) | |
+// AssemblyVersion: 3.0.1.0 | |
+// InformationalVersion: 3.0.1+56b07c7e2fda55d1e07a1fd4d2c6ac5210e8132f | |
// TargetFramework: .NETFramework,Version=v4.5 | |
// Configuration: Release | |
using System; | |
using System.IO; | |
using Smdn; | |
using Smdn.IO.Binary; | |
namespace Smdn.IO.Binary { | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryReader : BinaryReader { | |
protected BigEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public BigEndianBinaryReader(Stream stream) {} | |
public BigEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override ushort ReadUInt16() {} | |
public override UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public override UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryWriter : BinaryWriter { | |
protected BigEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public BigEndianBinaryWriter(Stream stream) {} | |
public BigEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public override void Write(UInt24 @value) {} | |
public override void Write(UInt48 @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public static class BinaryConversion { | |
public static int ByteSwap(int @value) {} | |
public static long ByteSwap(long @value) {} | |
public static short ByteSwap(short @value) {} | |
public static uint ByteSwap(uint @value) {} | |
public static ulong ByteSwap(ulong @value) {} | |
public static ushort ByteSwap(ushort @value) {} | |
public static byte[] GetBytes(UInt24 @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(UInt48 @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(int @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(long @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(short @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(uint @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(ulong @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(ushort @value, bool asLittleEndian) {} | |
public static void GetBytes(UInt24 @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(UInt48 @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(int @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(long @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(short @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(uint @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(ulong @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(ushort @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static byte[] GetBytesBE(UInt24 @value) {} | |
public static byte[] GetBytesBE(UInt48 @value) {} | |
public static byte[] GetBytesBE(int @value) {} | |
public static byte[] GetBytesBE(long @value) {} | |
public static byte[] GetBytesBE(short @value) {} | |
public static byte[] GetBytesBE(uint @value) {} | |
public static byte[] GetBytesBE(ulong @value) {} | |
public static byte[] GetBytesBE(ushort @value) {} | |
public static void GetBytesBE(UInt24 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(UInt48 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(int @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(long @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(short @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(uint @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(ulong @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(ushort @value, byte[] bytes, int startIndex) {} | |
public static byte[] GetBytesLE(UInt24 @value) {} | |
public static byte[] GetBytesLE(UInt48 @value) {} | |
public static byte[] GetBytesLE(int @value) {} | |
public static byte[] GetBytesLE(long @value) {} | |
public static byte[] GetBytesLE(short @value) {} | |
public static byte[] GetBytesLE(uint @value) {} | |
public static byte[] GetBytesLE(ulong @value) {} | |
public static byte[] GetBytesLE(ushort @value) {} | |
public static void GetBytesLE(UInt24 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(UInt48 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(int @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(long @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(short @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(uint @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(ulong @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(ushort @value, byte[] bytes, int startIndex) {} | |
public static short ToInt16(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static short ToInt16BE(byte[] @value, int startIndex) {} | |
public static short ToInt16LE(byte[] @value, int startIndex) {} | |
public static int ToInt32(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static int ToInt32BE(byte[] @value, int startIndex) {} | |
public static int ToInt32LE(byte[] @value, int startIndex) {} | |
public static long ToInt64(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static long ToInt64BE(byte[] @value, int startIndex) {} | |
public static long ToInt64LE(byte[] @value, int startIndex) {} | |
public static ushort ToUInt16(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static ushort ToUInt16BE(byte[] @value, int startIndex) {} | |
public static ushort ToUInt16LE(byte[] @value, int startIndex) {} | |
public static UInt24 ToUInt24(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static UInt24 ToUInt24BE(byte[] @value, int startIndex) {} | |
public static UInt24 ToUInt24LE(byte[] @value, int startIndex) {} | |
public static uint ToUInt32(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static uint ToUInt32BE(byte[] @value, int startIndex) {} | |
public static uint ToUInt32LE(byte[] @value, int startIndex) {} | |
public static UInt48 ToUInt48(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static UInt48 ToUInt48BE(byte[] @value, int startIndex) {} | |
public static UInt48 ToUInt48LE(byte[] @value, int startIndex) {} | |
public static ulong ToUInt64(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static ulong ToUInt64BE(byte[] @value, int startIndex) {} | |
public static ulong ToUInt64LE(byte[] @value, int startIndex) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryReader : BinaryReaderBase { | |
protected readonly byte[] Storage; | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) {} | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen, int storageSize) {} | |
public BinaryReader(Stream stream) {} | |
public BinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public bool IsLittleEndian { get; } | |
public override byte ReadByte() {} | |
public virtual FourCC ReadFourCC() {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override sbyte ReadSByte() {} | |
public override ushort ReadUInt16() {} | |
public virtual UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public virtual UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryReaderBase : IDisposable { | |
protected BinaryReaderBase(Stream baseStream, bool leaveBaseStreamOpen) {} | |
public Stream BaseStream { get; } | |
protected bool Disposed { get; } | |
public virtual bool EndOfStream { get; } | |
public bool LeaveBaseStreamOpen { get; } | |
protected void CheckDisposed() {} | |
public virtual void Close() {} | |
protected virtual void Dispose(bool disposing) {} | |
public virtual byte ReadByte() {} | |
protected int ReadBytes(byte[] buffer, int index, int count, bool readExactBytes) {} | |
public byte[] ReadBytes(int count) {} | |
public byte[] ReadBytes(long count) {} | |
public int ReadBytes(byte[] buffer, int index, int count) {} | |
protected virtual int ReadBytesUnchecked(byte[] buffer, int index, int count, bool readExactBytes) {} | |
public byte[] ReadExactBytes(int count) {} | |
public byte[] ReadExactBytes(long count) {} | |
public void ReadExactBytes(byte[] buffer, int index, int count) {} | |
public abstract short ReadInt16(); | |
public abstract int ReadInt32(); | |
public abstract long ReadInt64(); | |
public virtual sbyte ReadSByte() {} | |
public virtual byte[] ReadToEnd() {} | |
public virtual ushort ReadUInt16() {} | |
public virtual uint ReadUInt32() {} | |
public virtual ulong ReadUInt64() {} | |
void IDisposable.Dispose() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryWriter : BinaryWriterBase { | |
protected readonly byte[] Storage; | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) {} | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen, int storageSize) {} | |
public BinaryWriter(Stream stream) {} | |
public BinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public bool IsLittleEndian { get; } | |
public override void Write(byte @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(sbyte @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
public virtual void Write(FourCC @value) {} | |
public virtual void Write(UInt24 @value) {} | |
public virtual void Write(UInt48 @value) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryWriterBase : IDisposable { | |
protected BinaryWriterBase(Stream baseStream, bool leaveBaseStreamOpen) {} | |
public Stream BaseStream { get; } | |
protected bool Disposed { get; } | |
public bool LeaveBaseStreamOpen { get; } | |
protected void CheckDisposed() {} | |
public virtual void Close() {} | |
protected virtual void Dispose(bool disposing) {} | |
public void Flush() {} | |
void IDisposable.Dispose() {} | |
public abstract void Write(int @value); | |
public abstract void Write(long @value); | |
public abstract void Write(short @value); | |
public virtual void Write(byte @value) {} | |
public virtual void Write(sbyte @value) {} | |
public virtual void Write(uint @value) {} | |
public virtual void Write(ulong @value) {} | |
public virtual void Write(ushort @value) {} | |
public void Write(ArraySegment<byte> @value) {} | |
public void Write(byte[] buffer) {} | |
public void Write(byte[] buffer, int index, int count) {} | |
protected void WriteUnchecked(byte[] buffer, int index, int count) {} | |
public void WriteZero(int count) {} | |
public void WriteZero(long count) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryReader : BinaryReader { | |
protected LittleEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public LittleEndianBinaryReader(Stream stream) {} | |
public LittleEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override ushort ReadUInt16() {} | |
public override UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public override UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryWriter : BinaryWriter { | |
protected LittleEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public LittleEndianBinaryWriter(Stream stream) {} | |
public LittleEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public override void Write(UInt24 @value) {} | |
public override void Write(UInt48 @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
} | |
} | |
diff --git a/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-net46.apilist.cs b/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-net46.apilist.cs | |
index a5478661..68834878 100644 | |
--- a/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-net46.apilist.cs | |
+++ b/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-net46.apilist.cs | |
@@ -1,269 +1,269 @@ | |
-// Smdn.Fundamental.Stream.BinaryReaderWriter.dll (Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.0 (net46)) | |
+// Smdn.Fundamental.Stream.BinaryReaderWriter.dll (Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.1) | |
// Name: Smdn.Fundamental.Stream.BinaryReaderWriter | |
-// AssemblyVersion: 3.0.0.0 | |
-// InformationalVersion: 3.0.0 (net46) | |
+// AssemblyVersion: 3.0.1.0 | |
+// InformationalVersion: 3.0.1+56b07c7e2fda55d1e07a1fd4d2c6ac5210e8132f | |
// TargetFramework: .NETFramework,Version=v4.6 | |
// Configuration: Release | |
using System; | |
using System.IO; | |
using Smdn; | |
using Smdn.IO.Binary; | |
namespace Smdn.IO.Binary { | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryReader : BinaryReader { | |
protected BigEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public BigEndianBinaryReader(Stream stream) {} | |
public BigEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override ushort ReadUInt16() {} | |
public override UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public override UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryWriter : BinaryWriter { | |
protected BigEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public BigEndianBinaryWriter(Stream stream) {} | |
public BigEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public override void Write(UInt24 @value) {} | |
public override void Write(UInt48 @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public static class BinaryConversion { | |
public static int ByteSwap(int @value) {} | |
public static long ByteSwap(long @value) {} | |
public static short ByteSwap(short @value) {} | |
public static uint ByteSwap(uint @value) {} | |
public static ulong ByteSwap(ulong @value) {} | |
public static ushort ByteSwap(ushort @value) {} | |
public static byte[] GetBytes(UInt24 @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(UInt48 @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(int @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(long @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(short @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(uint @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(ulong @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(ushort @value, bool asLittleEndian) {} | |
public static void GetBytes(UInt24 @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(UInt48 @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(int @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(long @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(short @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(uint @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(ulong @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(ushort @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static byte[] GetBytesBE(UInt24 @value) {} | |
public static byte[] GetBytesBE(UInt48 @value) {} | |
public static byte[] GetBytesBE(int @value) {} | |
public static byte[] GetBytesBE(long @value) {} | |
public static byte[] GetBytesBE(short @value) {} | |
public static byte[] GetBytesBE(uint @value) {} | |
public static byte[] GetBytesBE(ulong @value) {} | |
public static byte[] GetBytesBE(ushort @value) {} | |
public static void GetBytesBE(UInt24 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(UInt48 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(int @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(long @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(short @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(uint @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(ulong @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(ushort @value, byte[] bytes, int startIndex) {} | |
public static byte[] GetBytesLE(UInt24 @value) {} | |
public static byte[] GetBytesLE(UInt48 @value) {} | |
public static byte[] GetBytesLE(int @value) {} | |
public static byte[] GetBytesLE(long @value) {} | |
public static byte[] GetBytesLE(short @value) {} | |
public static byte[] GetBytesLE(uint @value) {} | |
public static byte[] GetBytesLE(ulong @value) {} | |
public static byte[] GetBytesLE(ushort @value) {} | |
public static void GetBytesLE(UInt24 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(UInt48 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(int @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(long @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(short @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(uint @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(ulong @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(ushort @value, byte[] bytes, int startIndex) {} | |
public static short ToInt16(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static short ToInt16BE(byte[] @value, int startIndex) {} | |
public static short ToInt16LE(byte[] @value, int startIndex) {} | |
public static int ToInt32(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static int ToInt32BE(byte[] @value, int startIndex) {} | |
public static int ToInt32LE(byte[] @value, int startIndex) {} | |
public static long ToInt64(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static long ToInt64BE(byte[] @value, int startIndex) {} | |
public static long ToInt64LE(byte[] @value, int startIndex) {} | |
public static ushort ToUInt16(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static ushort ToUInt16BE(byte[] @value, int startIndex) {} | |
public static ushort ToUInt16LE(byte[] @value, int startIndex) {} | |
public static UInt24 ToUInt24(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static UInt24 ToUInt24BE(byte[] @value, int startIndex) {} | |
public static UInt24 ToUInt24LE(byte[] @value, int startIndex) {} | |
public static uint ToUInt32(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static uint ToUInt32BE(byte[] @value, int startIndex) {} | |
public static uint ToUInt32LE(byte[] @value, int startIndex) {} | |
public static UInt48 ToUInt48(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static UInt48 ToUInt48BE(byte[] @value, int startIndex) {} | |
public static UInt48 ToUInt48LE(byte[] @value, int startIndex) {} | |
public static ulong ToUInt64(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static ulong ToUInt64BE(byte[] @value, int startIndex) {} | |
public static ulong ToUInt64LE(byte[] @value, int startIndex) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryReader : BinaryReaderBase { | |
protected readonly byte[] Storage; | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) {} | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen, int storageSize) {} | |
public BinaryReader(Stream stream) {} | |
public BinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public bool IsLittleEndian { get; } | |
public override byte ReadByte() {} | |
public virtual FourCC ReadFourCC() {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override sbyte ReadSByte() {} | |
public override ushort ReadUInt16() {} | |
public virtual UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public virtual UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryReaderBase : IDisposable { | |
protected BinaryReaderBase(Stream baseStream, bool leaveBaseStreamOpen) {} | |
public Stream BaseStream { get; } | |
protected bool Disposed { get; } | |
public virtual bool EndOfStream { get; } | |
public bool LeaveBaseStreamOpen { get; } | |
protected void CheckDisposed() {} | |
public virtual void Close() {} | |
protected virtual void Dispose(bool disposing) {} | |
public virtual byte ReadByte() {} | |
protected int ReadBytes(byte[] buffer, int index, int count, bool readExactBytes) {} | |
public byte[] ReadBytes(int count) {} | |
public byte[] ReadBytes(long count) {} | |
public int ReadBytes(byte[] buffer, int index, int count) {} | |
protected virtual int ReadBytesUnchecked(byte[] buffer, int index, int count, bool readExactBytes) {} | |
public byte[] ReadExactBytes(int count) {} | |
public byte[] ReadExactBytes(long count) {} | |
public void ReadExactBytes(byte[] buffer, int index, int count) {} | |
public abstract short ReadInt16(); | |
public abstract int ReadInt32(); | |
public abstract long ReadInt64(); | |
public virtual sbyte ReadSByte() {} | |
public virtual byte[] ReadToEnd() {} | |
public virtual ushort ReadUInt16() {} | |
public virtual uint ReadUInt32() {} | |
public virtual ulong ReadUInt64() {} | |
void IDisposable.Dispose() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryWriter : BinaryWriterBase { | |
protected readonly byte[] Storage; | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) {} | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen, int storageSize) {} | |
public BinaryWriter(Stream stream) {} | |
public BinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public bool IsLittleEndian { get; } | |
public override void Write(byte @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(sbyte @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
public virtual void Write(FourCC @value) {} | |
public virtual void Write(UInt24 @value) {} | |
public virtual void Write(UInt48 @value) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryWriterBase : IDisposable { | |
protected BinaryWriterBase(Stream baseStream, bool leaveBaseStreamOpen) {} | |
public Stream BaseStream { get; } | |
protected bool Disposed { get; } | |
public bool LeaveBaseStreamOpen { get; } | |
protected void CheckDisposed() {} | |
public virtual void Close() {} | |
protected virtual void Dispose(bool disposing) {} | |
public void Flush() {} | |
void IDisposable.Dispose() {} | |
public abstract void Write(int @value); | |
public abstract void Write(long @value); | |
public abstract void Write(short @value); | |
public virtual void Write(byte @value) {} | |
public virtual void Write(sbyte @value) {} | |
public virtual void Write(uint @value) {} | |
public virtual void Write(ulong @value) {} | |
public virtual void Write(ushort @value) {} | |
public void Write(ArraySegment<byte> @value) {} | |
public void Write(byte[] buffer) {} | |
public void Write(byte[] buffer, int index, int count) {} | |
protected void WriteUnchecked(byte[] buffer, int index, int count) {} | |
public void WriteZero(int count) {} | |
public void WriteZero(long count) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryReader : BinaryReader { | |
protected LittleEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public LittleEndianBinaryReader(Stream stream) {} | |
public LittleEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override ushort ReadUInt16() {} | |
public override UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public override UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryWriter : BinaryWriter { | |
protected LittleEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public LittleEndianBinaryWriter(Stream stream) {} | |
public LittleEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public override void Write(UInt24 @value) {} | |
public override void Write(UInt48 @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
} | |
} | |
diff --git a/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-netstandard1.6.apilist.cs b/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-netstandard1.6.apilist.cs | |
index f7dcf67e..f21100ef 100644 | |
--- a/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-netstandard1.6.apilist.cs | |
+++ b/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-netstandard1.6.apilist.cs | |
@@ -1,269 +1,269 @@ | |
-// Smdn.Fundamental.Stream.BinaryReaderWriter.dll (Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.0 (netstandard1.6)) | |
+// Smdn.Fundamental.Stream.BinaryReaderWriter.dll (Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.1) | |
// Name: Smdn.Fundamental.Stream.BinaryReaderWriter | |
-// AssemblyVersion: 3.0.0.0 | |
-// InformationalVersion: 3.0.0 (netstandard1.6) | |
+// AssemblyVersion: 3.0.1.0 | |
+// InformationalVersion: 3.0.1+56b07c7e2fda55d1e07a1fd4d2c6ac5210e8132f | |
// TargetFramework: .NETStandard,Version=v1.6 | |
// Configuration: Release | |
using System; | |
using System.IO; | |
using Smdn; | |
using Smdn.IO.Binary; | |
namespace Smdn.IO.Binary { | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryReader : BinaryReader { | |
protected BigEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public BigEndianBinaryReader(Stream stream) {} | |
public BigEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override ushort ReadUInt16() {} | |
public override UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public override UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryWriter : BinaryWriter { | |
protected BigEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public BigEndianBinaryWriter(Stream stream) {} | |
public BigEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public override void Write(UInt24 @value) {} | |
public override void Write(UInt48 @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public static class BinaryConversion { | |
public static int ByteSwap(int @value) {} | |
public static long ByteSwap(long @value) {} | |
public static short ByteSwap(short @value) {} | |
public static uint ByteSwap(uint @value) {} | |
public static ulong ByteSwap(ulong @value) {} | |
public static ushort ByteSwap(ushort @value) {} | |
public static byte[] GetBytes(UInt24 @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(UInt48 @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(int @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(long @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(short @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(uint @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(ulong @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(ushort @value, bool asLittleEndian) {} | |
public static void GetBytes(UInt24 @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(UInt48 @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(int @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(long @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(short @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(uint @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(ulong @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(ushort @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static byte[] GetBytesBE(UInt24 @value) {} | |
public static byte[] GetBytesBE(UInt48 @value) {} | |
public static byte[] GetBytesBE(int @value) {} | |
public static byte[] GetBytesBE(long @value) {} | |
public static byte[] GetBytesBE(short @value) {} | |
public static byte[] GetBytesBE(uint @value) {} | |
public static byte[] GetBytesBE(ulong @value) {} | |
public static byte[] GetBytesBE(ushort @value) {} | |
public static void GetBytesBE(UInt24 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(UInt48 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(int @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(long @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(short @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(uint @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(ulong @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(ushort @value, byte[] bytes, int startIndex) {} | |
public static byte[] GetBytesLE(UInt24 @value) {} | |
public static byte[] GetBytesLE(UInt48 @value) {} | |
public static byte[] GetBytesLE(int @value) {} | |
public static byte[] GetBytesLE(long @value) {} | |
public static byte[] GetBytesLE(short @value) {} | |
public static byte[] GetBytesLE(uint @value) {} | |
public static byte[] GetBytesLE(ulong @value) {} | |
public static byte[] GetBytesLE(ushort @value) {} | |
public static void GetBytesLE(UInt24 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(UInt48 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(int @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(long @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(short @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(uint @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(ulong @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(ushort @value, byte[] bytes, int startIndex) {} | |
public static short ToInt16(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static short ToInt16BE(byte[] @value, int startIndex) {} | |
public static short ToInt16LE(byte[] @value, int startIndex) {} | |
public static int ToInt32(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static int ToInt32BE(byte[] @value, int startIndex) {} | |
public static int ToInt32LE(byte[] @value, int startIndex) {} | |
public static long ToInt64(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static long ToInt64BE(byte[] @value, int startIndex) {} | |
public static long ToInt64LE(byte[] @value, int startIndex) {} | |
public static ushort ToUInt16(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static ushort ToUInt16BE(byte[] @value, int startIndex) {} | |
public static ushort ToUInt16LE(byte[] @value, int startIndex) {} | |
public static UInt24 ToUInt24(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static UInt24 ToUInt24BE(byte[] @value, int startIndex) {} | |
public static UInt24 ToUInt24LE(byte[] @value, int startIndex) {} | |
public static uint ToUInt32(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static uint ToUInt32BE(byte[] @value, int startIndex) {} | |
public static uint ToUInt32LE(byte[] @value, int startIndex) {} | |
public static UInt48 ToUInt48(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static UInt48 ToUInt48BE(byte[] @value, int startIndex) {} | |
public static UInt48 ToUInt48LE(byte[] @value, int startIndex) {} | |
public static ulong ToUInt64(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static ulong ToUInt64BE(byte[] @value, int startIndex) {} | |
public static ulong ToUInt64LE(byte[] @value, int startIndex) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryReader : BinaryReaderBase { | |
protected readonly byte[] Storage; | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) {} | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen, int storageSize) {} | |
public BinaryReader(Stream stream) {} | |
public BinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public bool IsLittleEndian { get; } | |
public override byte ReadByte() {} | |
public virtual FourCC ReadFourCC() {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override sbyte ReadSByte() {} | |
public override ushort ReadUInt16() {} | |
public virtual UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public virtual UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryReaderBase : IDisposable { | |
protected BinaryReaderBase(Stream baseStream, bool leaveBaseStreamOpen) {} | |
public Stream BaseStream { get; } | |
protected bool Disposed { get; } | |
public virtual bool EndOfStream { get; } | |
public bool LeaveBaseStreamOpen { get; } | |
protected void CheckDisposed() {} | |
public virtual void Close() {} | |
protected virtual void Dispose(bool disposing) {} | |
public virtual byte ReadByte() {} | |
protected int ReadBytes(byte[] buffer, int index, int count, bool readExactBytes) {} | |
public byte[] ReadBytes(int count) {} | |
public byte[] ReadBytes(long count) {} | |
public int ReadBytes(byte[] buffer, int index, int count) {} | |
protected virtual int ReadBytesUnchecked(byte[] buffer, int index, int count, bool readExactBytes) {} | |
public byte[] ReadExactBytes(int count) {} | |
public byte[] ReadExactBytes(long count) {} | |
public void ReadExactBytes(byte[] buffer, int index, int count) {} | |
public abstract short ReadInt16(); | |
public abstract int ReadInt32(); | |
public abstract long ReadInt64(); | |
public virtual sbyte ReadSByte() {} | |
public virtual byte[] ReadToEnd() {} | |
public virtual ushort ReadUInt16() {} | |
public virtual uint ReadUInt32() {} | |
public virtual ulong ReadUInt64() {} | |
void IDisposable.Dispose() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryWriter : BinaryWriterBase { | |
protected readonly byte[] Storage; | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) {} | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen, int storageSize) {} | |
public BinaryWriter(Stream stream) {} | |
public BinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public bool IsLittleEndian { get; } | |
public override void Write(byte @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(sbyte @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
public virtual void Write(FourCC @value) {} | |
public virtual void Write(UInt24 @value) {} | |
public virtual void Write(UInt48 @value) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryWriterBase : IDisposable { | |
protected BinaryWriterBase(Stream baseStream, bool leaveBaseStreamOpen) {} | |
public Stream BaseStream { get; } | |
protected bool Disposed { get; } | |
public bool LeaveBaseStreamOpen { get; } | |
protected void CheckDisposed() {} | |
public virtual void Close() {} | |
protected virtual void Dispose(bool disposing) {} | |
public void Flush() {} | |
void IDisposable.Dispose() {} | |
public abstract void Write(int @value); | |
public abstract void Write(long @value); | |
public abstract void Write(short @value); | |
public virtual void Write(byte @value) {} | |
public virtual void Write(sbyte @value) {} | |
public virtual void Write(uint @value) {} | |
public virtual void Write(ulong @value) {} | |
public virtual void Write(ushort @value) {} | |
public void Write(ArraySegment<byte> @value) {} | |
public void Write(byte[] buffer) {} | |
public void Write(byte[] buffer, int index, int count) {} | |
protected void WriteUnchecked(byte[] buffer, int index, int count) {} | |
public void WriteZero(int count) {} | |
public void WriteZero(long count) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryReader : BinaryReader { | |
protected LittleEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public LittleEndianBinaryReader(Stream stream) {} | |
public LittleEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override ushort ReadUInt16() {} | |
public override UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public override UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryWriter : BinaryWriter { | |
protected LittleEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public LittleEndianBinaryWriter(Stream stream) {} | |
public LittleEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public override void Write(UInt24 @value) {} | |
public override void Write(UInt48 @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
} | |
} | |
diff --git a/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-netstandard2.1.apilist.cs b/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-netstandard2.1.apilist.cs | |
index 53f7e4e6..2c269119 100644 | |
--- a/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-netstandard2.1.apilist.cs | |
+++ b/doc/api-list/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter-netstandard2.1.apilist.cs | |
@@ -1,269 +1,269 @@ | |
-// Smdn.Fundamental.Stream.BinaryReaderWriter.dll (Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.0 (netstandard2.1)) | |
+// Smdn.Fundamental.Stream.BinaryReaderWriter.dll (Smdn.Fundamental.Stream.BinaryReaderWriter-3.0.1) | |
// Name: Smdn.Fundamental.Stream.BinaryReaderWriter | |
-// AssemblyVersion: 3.0.0.0 | |
-// InformationalVersion: 3.0.0 (netstandard2.1) | |
+// AssemblyVersion: 3.0.1.0 | |
+// InformationalVersion: 3.0.1+56b07c7e2fda55d1e07a1fd4d2c6ac5210e8132f | |
// TargetFramework: .NETStandard,Version=v2.1 | |
// Configuration: Release | |
using System; | |
using System.IO; | |
using Smdn; | |
using Smdn.IO.Binary; | |
namespace Smdn.IO.Binary { | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryReader : BinaryReader { | |
protected BigEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public BigEndianBinaryReader(Stream stream) {} | |
public BigEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override ushort ReadUInt16() {} | |
public override UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public override UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryWriter : BinaryWriter { | |
protected BigEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public BigEndianBinaryWriter(Stream stream) {} | |
public BigEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public override void Write(UInt24 @value) {} | |
public override void Write(UInt48 @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public static class BinaryConversion { | |
public static int ByteSwap(int @value) {} | |
public static long ByteSwap(long @value) {} | |
public static short ByteSwap(short @value) {} | |
public static uint ByteSwap(uint @value) {} | |
public static ulong ByteSwap(ulong @value) {} | |
public static ushort ByteSwap(ushort @value) {} | |
public static byte[] GetBytes(UInt24 @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(UInt48 @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(int @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(long @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(short @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(uint @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(ulong @value, bool asLittleEndian) {} | |
public static byte[] GetBytes(ushort @value, bool asLittleEndian) {} | |
public static void GetBytes(UInt24 @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(UInt48 @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(int @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(long @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(short @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(uint @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(ulong @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static void GetBytes(ushort @value, bool asLittleEndian, byte[] bytes, int startIndex) {} | |
public static byte[] GetBytesBE(UInt24 @value) {} | |
public static byte[] GetBytesBE(UInt48 @value) {} | |
public static byte[] GetBytesBE(int @value) {} | |
public static byte[] GetBytesBE(long @value) {} | |
public static byte[] GetBytesBE(short @value) {} | |
public static byte[] GetBytesBE(uint @value) {} | |
public static byte[] GetBytesBE(ulong @value) {} | |
public static byte[] GetBytesBE(ushort @value) {} | |
public static void GetBytesBE(UInt24 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(UInt48 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(int @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(long @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(short @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(uint @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(ulong @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesBE(ushort @value, byte[] bytes, int startIndex) {} | |
public static byte[] GetBytesLE(UInt24 @value) {} | |
public static byte[] GetBytesLE(UInt48 @value) {} | |
public static byte[] GetBytesLE(int @value) {} | |
public static byte[] GetBytesLE(long @value) {} | |
public static byte[] GetBytesLE(short @value) {} | |
public static byte[] GetBytesLE(uint @value) {} | |
public static byte[] GetBytesLE(ulong @value) {} | |
public static byte[] GetBytesLE(ushort @value) {} | |
public static void GetBytesLE(UInt24 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(UInt48 @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(int @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(long @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(short @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(uint @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(ulong @value, byte[] bytes, int startIndex) {} | |
public static void GetBytesLE(ushort @value, byte[] bytes, int startIndex) {} | |
public static short ToInt16(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static short ToInt16BE(byte[] @value, int startIndex) {} | |
public static short ToInt16LE(byte[] @value, int startIndex) {} | |
public static int ToInt32(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static int ToInt32BE(byte[] @value, int startIndex) {} | |
public static int ToInt32LE(byte[] @value, int startIndex) {} | |
public static long ToInt64(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static long ToInt64BE(byte[] @value, int startIndex) {} | |
public static long ToInt64LE(byte[] @value, int startIndex) {} | |
public static ushort ToUInt16(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static ushort ToUInt16BE(byte[] @value, int startIndex) {} | |
public static ushort ToUInt16LE(byte[] @value, int startIndex) {} | |
public static UInt24 ToUInt24(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static UInt24 ToUInt24BE(byte[] @value, int startIndex) {} | |
public static UInt24 ToUInt24LE(byte[] @value, int startIndex) {} | |
public static uint ToUInt32(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static uint ToUInt32BE(byte[] @value, int startIndex) {} | |
public static uint ToUInt32LE(byte[] @value, int startIndex) {} | |
public static UInt48 ToUInt48(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static UInt48 ToUInt48BE(byte[] @value, int startIndex) {} | |
public static UInt48 ToUInt48LE(byte[] @value, int startIndex) {} | |
public static ulong ToUInt64(byte[] @value, int startIndex, bool asLittleEndian) {} | |
public static ulong ToUInt64BE(byte[] @value, int startIndex) {} | |
public static ulong ToUInt64LE(byte[] @value, int startIndex) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryReader : BinaryReaderBase { | |
protected readonly byte[] Storage; | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) {} | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen, int storageSize) {} | |
public BinaryReader(Stream stream) {} | |
public BinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public bool IsLittleEndian { get; } | |
public override byte ReadByte() {} | |
public virtual FourCC ReadFourCC() {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override sbyte ReadSByte() {} | |
public override ushort ReadUInt16() {} | |
public virtual UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public virtual UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryReaderBase : IDisposable { | |
protected BinaryReaderBase(Stream baseStream, bool leaveBaseStreamOpen) {} | |
public Stream BaseStream { get; } | |
protected bool Disposed { get; } | |
public virtual bool EndOfStream { get; } | |
public bool LeaveBaseStreamOpen { get; } | |
protected void CheckDisposed() {} | |
public virtual void Close() {} | |
protected virtual void Dispose(bool disposing) {} | |
public virtual byte ReadByte() {} | |
protected int ReadBytes(byte[] buffer, int index, int count, bool readExactBytes) {} | |
public byte[] ReadBytes(int count) {} | |
public byte[] ReadBytes(long count) {} | |
public int ReadBytes(byte[] buffer, int index, int count) {} | |
protected virtual int ReadBytesUnchecked(byte[] buffer, int index, int count, bool readExactBytes) {} | |
public byte[] ReadExactBytes(int count) {} | |
public byte[] ReadExactBytes(long count) {} | |
public void ReadExactBytes(byte[] buffer, int index, int count) {} | |
public abstract short ReadInt16(); | |
public abstract int ReadInt32(); | |
public abstract long ReadInt64(); | |
public virtual sbyte ReadSByte() {} | |
public virtual byte[] ReadToEnd() {} | |
public virtual ushort ReadUInt16() {} | |
public virtual uint ReadUInt32() {} | |
public virtual ulong ReadUInt64() {} | |
void IDisposable.Dispose() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryWriter : BinaryWriterBase { | |
protected readonly byte[] Storage; | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) {} | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen, int storageSize) {} | |
public BinaryWriter(Stream stream) {} | |
public BinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public bool IsLittleEndian { get; } | |
public override void Write(byte @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(sbyte @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
public virtual void Write(FourCC @value) {} | |
public virtual void Write(UInt24 @value) {} | |
public virtual void Write(UInt48 @value) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryWriterBase : IDisposable { | |
protected BinaryWriterBase(Stream baseStream, bool leaveBaseStreamOpen) {} | |
public Stream BaseStream { get; } | |
protected bool Disposed { get; } | |
public bool LeaveBaseStreamOpen { get; } | |
protected void CheckDisposed() {} | |
public virtual void Close() {} | |
protected virtual void Dispose(bool disposing) {} | |
public void Flush() {} | |
void IDisposable.Dispose() {} | |
public abstract void Write(int @value); | |
public abstract void Write(long @value); | |
public abstract void Write(short @value); | |
public virtual void Write(byte @value) {} | |
public virtual void Write(sbyte @value) {} | |
public virtual void Write(uint @value) {} | |
public virtual void Write(ulong @value) {} | |
public virtual void Write(ushort @value) {} | |
public void Write(ArraySegment<byte> @value) {} | |
public void Write(byte[] buffer) {} | |
public void Write(byte[] buffer, int index, int count) {} | |
protected void WriteUnchecked(byte[] buffer, int index, int count) {} | |
public void WriteZero(int count) {} | |
public void WriteZero(long count) {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryReader : BinaryReader { | |
protected LittleEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public LittleEndianBinaryReader(Stream stream) {} | |
public LittleEndianBinaryReader(Stream stream, bool leaveBaseStreamOpen) {} | |
public override short ReadInt16() {} | |
public override int ReadInt32() {} | |
public override long ReadInt64() {} | |
public override ushort ReadUInt16() {} | |
public override UInt24 ReadUInt24() {} | |
public override uint ReadUInt32() {} | |
public override UInt48 ReadUInt48() {} | |
public override ulong ReadUInt64() {} | |
} | |
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryWriter : BinaryWriter { | |
protected LittleEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen, int storageSize) {} | |
public LittleEndianBinaryWriter(Stream stream) {} | |
public LittleEndianBinaryWriter(Stream stream, bool leaveBaseStreamOpen) {} | |
public override void Write(UInt24 @value) {} | |
public override void Write(UInt48 @value) {} | |
public override void Write(int @value) {} | |
public override void Write(long @value) {} | |
public override void Write(short @value) {} | |
public override void Write(uint @value) {} | |
public override void Write(ulong @value) {} | |
public override void Write(ushort @value) {} | |
} | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/.editorconfig b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/.editorconfig | |
new file mode 100644 | |
index 00000000..43797129 | |
--- /dev/null | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/.editorconfig | |
@@ -0,0 +1,6 @@ | |
+# EditorConfig is awesome: https://EditorConfig.org | |
+ | |
+[*.cs] | |
+dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast | |
+dotnet_diagnostic.IDE0047.severity = none # Remove unnecessary parentheses | |
+dotnet_diagnostic.IDE0049.severity = none # Use language keywords instead of framework type names for type references | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter.csproj b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter.csproj | |
index 301c3563..501099a0 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter.csproj | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.Fundamental.Stream.BinaryReaderWriter.csproj | |
@@ -5,15 +5,17 @@ SPDX-License-Identifier: MIT | |
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFrameworks>net46;net45;netstandard2.1;netstandard1.6</TargetFrameworks> | |
- <VersionPrefix>3.0.0</VersionPrefix> | |
+ <VersionPrefix>3.0.1</VersionPrefix> | |
<VersionSuffix></VersionSuffix> | |
+ <PackageValidationBaselineVersion>3.0.0</PackageValidationBaselineVersion> | |
</PropertyGroup> | |
- <PropertyGroup Label="metadata"> | |
+ <PropertyGroup Label="assembly attributes"> | |
<CopyrightYear>2021</CopyrightYear> | |
+ </PropertyGroup> | |
- <!-- NuGet --> | |
- <!--<PackageTags></PackageTags>--> | |
+ <PropertyGroup Label="package properties"> | |
+ <PackageTags>io;reader;writer;binary;extensions</PackageTags> | |
</PropertyGroup> | |
<ItemGroup> | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BigEndianBinaryReader.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BigEndianBinaryReader.cs | |
index 9ee40509..8c0a396d 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BigEndianBinaryReader.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BigEndianBinaryReader.cs | |
@@ -3,7 +3,8 @@ | |
using System; | |
using System.IO; | |
-namespace Smdn.IO.Binary { | |
+namespace Smdn.IO.Binary; | |
+ | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryReader : Smdn.IO.Binary.BinaryReader { | |
public BigEndianBinaryReader(Stream stream) | |
@@ -80,4 +81,3 @@ namespace Smdn.IO.Binary { | |
return BinaryConversion.ToUInt48BE(Storage, 0); | |
} | |
} | |
-} | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BigEndianBinaryWriter.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BigEndianBinaryWriter.cs | |
index cc60d6eb..b2bad819 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BigEndianBinaryWriter.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BigEndianBinaryWriter.cs | |
@@ -3,7 +3,8 @@ | |
using System; | |
using System.IO; | |
-namespace Smdn.IO.Binary { | |
+namespace Smdn.IO.Binary; | |
+ | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BigEndianBinaryWriter : Smdn.IO.Binary.BinaryWriter { | |
public BigEndianBinaryWriter(Stream stream) | |
@@ -80,4 +81,3 @@ namespace Smdn.IO.Binary { | |
WriteUnchecked(Storage, 0, 6); | |
} | |
} | |
-} | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryConversion.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryConversion.cs | |
index 750997f2..df5e1ff7 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryConversion.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryConversion.cs | |
@@ -1,8 +1,14 @@ | |
// SPDX-FileCopyrightText: 2010 smdn <smdn@smdn.jp> | |
// SPDX-License-Identifier: MIT | |
+ | |
+#pragma warning disable SA1011 // Closing square brackets should be spaced correctly | |
+#pragma warning disable SA1121 // Use built-in type alias | |
+#pragma warning disable IDE0055 // Fix formatting | |
+ | |
using System; | |
-namespace Smdn.IO.Binary { | |
+namespace Smdn.IO.Binary; | |
+ | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public static class BinaryConversion { | |
private static void CheckSourceArray(byte[] @value, int startIndex, int count) | |
@@ -25,20 +31,10 @@ namespace Smdn.IO.Binary { | |
throw ExceptionUtils.CreateArgumentAttemptToAccessBeyondEndOfArray(nameof(startIndex), @bytes, startIndex, count); | |
} | |
- public static Int16 ByteSwap(Int16 @value) | |
- { | |
- unchecked { | |
- return (Int16)(((@value >> 8) & 0x00ff) | (@value << 8)); | |
- } | |
- } | |
+ public static Int16 ByteSwap(Int16 @value) => unchecked((Int16)(((@value >> 8) & 0x00ff) | (@value << 8))); | |
[CLSCompliant(false)] | |
- public static UInt16 ByteSwap(UInt16 @value) | |
- { | |
- unchecked { | |
- return (UInt16)(((@value >> 8) & 0x00ff) | (@value << 8)); | |
- } | |
- } | |
+ public static UInt16 ByteSwap(UInt16 @value) => unchecked((UInt16)(((@value >> 8) & 0x00ff) | (@value << 8))); | |
public static Int32 ByteSwap(Int32 @value) | |
{ | |
@@ -90,28 +86,19 @@ namespace Smdn.IO.Binary { | |
} | |
} | |
- public static Int16 ToInt16LE(byte[] @value, int startIndex) | |
- { | |
- return unchecked((Int16)ToUInt16LE(@value, startIndex)); | |
- } | |
- | |
- public static Int16 ToInt16BE(byte[] @value, int startIndex) | |
- { | |
- return unchecked((Int16)ToUInt16BE(@value, startIndex)); | |
- } | |
- | |
- public static Int16 ToInt16(byte[] @value, int startIndex, bool asLittleEndian) | |
- { | |
- return unchecked((Int16)ToUInt16(@value, startIndex, asLittleEndian)); | |
- } | |
+ public static Int16 ToInt16LE(byte[] @value, int startIndex) => unchecked((Int16)ToUInt16LE(@value, startIndex)); | |
+ public static Int16 ToInt16BE(byte[] @value, int startIndex) => unchecked((Int16)ToUInt16BE(@value, startIndex)); | |
+ public static Int16 ToInt16(byte[] @value, int startIndex, bool asLittleEndian) => unchecked((Int16)ToUInt16(@value, startIndex, asLittleEndian)); | |
[CLSCompliant(false)] | |
public static UInt16 ToUInt16LE(byte[] @value, int startIndex) | |
{ | |
CheckSourceArray(@value, startIndex, 2); | |
- return (UInt16)(@value[startIndex] | | |
- @value[startIndex + 1] << 8); | |
+ return (UInt16)( | |
+ @value[startIndex] | | |
+ (@value[startIndex + 1] << 8) | |
+ ); | |
} | |
[CLSCompliant(false)] | |
@@ -119,8 +106,10 @@ namespace Smdn.IO.Binary { | |
{ | |
CheckSourceArray(@value, startIndex, 2); | |
- return (UInt16)(@value[startIndex] << 8 | | |
- @value[startIndex + 1]); | |
+ return (UInt16)( | |
+ (@value[startIndex] << 8) | | |
+ @value[startIndex + 1] | |
+ ); | |
} | |
[CLSCompliant(false)] | |
@@ -129,30 +118,21 @@ namespace Smdn.IO.Binary { | |
? ToUInt16LE(@value, startIndex) | |
: ToUInt16BE(@value, startIndex); | |
- public static Int32 ToInt32LE(byte[] @value, int startIndex) | |
- { | |
- return unchecked((Int32)ToUInt32LE(@value, startIndex)); | |
- } | |
- | |
- public static Int32 ToInt32BE(byte[] @value, int startIndex) | |
- { | |
- return unchecked((Int32)ToUInt32BE(@value, startIndex)); | |
- } | |
- | |
- public static Int32 ToInt32(byte[] @value, int startIndex, bool asLittleEndian) | |
- { | |
- return unchecked((Int32)ToUInt32(@value, startIndex, asLittleEndian)); | |
- } | |
+ public static Int32 ToInt32LE(byte[] @value, int startIndex) => unchecked((Int32)ToUInt32LE(@value, startIndex)); | |
+ public static Int32 ToInt32BE(byte[] @value, int startIndex) => unchecked((Int32)ToUInt32BE(@value, startIndex)); | |
+ public static Int32 ToInt32(byte[] @value, int startIndex, bool asLittleEndian) => unchecked((Int32)ToUInt32(@value, startIndex, asLittleEndian)); | |
[CLSCompliant(false)] | |
public static UInt32 ToUInt32LE(byte[] @value, int startIndex) | |
{ | |
CheckSourceArray(@value, startIndex, 4); | |
- return (UInt32)(@value[startIndex] | | |
- @value[startIndex + 1] << 8 | | |
- @value[startIndex + 2] << 16 | | |
- @value[startIndex + 3] << 24); | |
+ return (UInt32)( | |
+ @value[startIndex] | | |
+ (@value[startIndex + 1] << 8) | | |
+ (@value[startIndex + 2] << 16) | | |
+ (@value[startIndex + 3] << 24) | |
+ ); | |
} | |
[CLSCompliant(false)] | |
@@ -160,10 +140,12 @@ namespace Smdn.IO.Binary { | |
{ | |
CheckSourceArray(@value, startIndex, 4); | |
- return (UInt32)(@value[startIndex] << 24 | | |
- @value[startIndex + 1] << 16 | | |
- @value[startIndex + 2] << 8 | | |
- @value[startIndex + 3]); | |
+ return (UInt32)( | |
+ (@value[startIndex] << 24) | | |
+ (@value[startIndex + 1] << 16) | | |
+ (@value[startIndex + 2] << 8) | | |
+ @value[startIndex + 3] | |
+ ); | |
} | |
[CLSCompliant(false)] | |
@@ -172,36 +154,29 @@ namespace Smdn.IO.Binary { | |
? ToUInt32LE(@value, startIndex) | |
: ToUInt32BE(@value, startIndex); | |
- public static Int64 ToInt64LE(byte[] @value, int startIndex) | |
- { | |
- return unchecked((Int64)ToUInt64LE(@value, startIndex)); | |
- } | |
- | |
- public static Int64 ToInt64BE(byte[] @value, int startIndex) | |
- { | |
- return unchecked((Int64)ToUInt64BE(@value, startIndex)); | |
- } | |
- | |
- public static Int64 ToInt64(byte[] @value, int startIndex, bool asLittleEndian) | |
- { | |
- return unchecked((Int64)ToUInt64(@value, startIndex, asLittleEndian)); | |
- } | |
+ public static Int64 ToInt64LE(byte[] @value, int startIndex) => unchecked((Int64)ToUInt64LE(@value, startIndex)); | |
+ public static Int64 ToInt64BE(byte[] @value, int startIndex) => unchecked((Int64)ToUInt64BE(@value, startIndex)); | |
+ public static Int64 ToInt64(byte[] @value, int startIndex, bool asLittleEndian) => unchecked((Int64)ToUInt64(@value, startIndex, asLittleEndian)); | |
[CLSCompliant(false)] | |
public static UInt64 ToUInt64LE(byte[] @value, int startIndex) | |
{ | |
CheckSourceArray(@value, startIndex, 8); | |
- UInt64 low = (UInt32)(@value[startIndex] | | |
- @value[startIndex + 1] << 8 | | |
- @value[startIndex + 2] << 16 | | |
- @value[startIndex + 3] << 24); | |
- UInt64 high = (UInt32)(@value[startIndex + 4 ] | | |
- @value[startIndex + 5] << 8 | | |
- @value[startIndex + 6] << 16 | | |
- @value[startIndex + 7] << 24); | |
+ UInt64 low = (UInt32)( | |
+ @value[startIndex] | | |
+ (@value[startIndex + 1] << 8) | | |
+ (@value[startIndex + 2] << 16) | | |
+ (@value[startIndex + 3] << 24) | |
+ ); | |
+ UInt64 high = (UInt32)( | |
+ @value[startIndex + 4 ] | | |
+ (@value[startIndex + 5] << 8) | | |
+ (@value[startIndex + 6] << 16) | | |
+ (@value[startIndex + 7] << 24) | |
+ ); | |
- return high << 32 | low; | |
+ return (high << 32) | low; | |
} | |
[CLSCompliant(false)] | |
@@ -209,16 +184,20 @@ namespace Smdn.IO.Binary { | |
{ | |
CheckSourceArray(@value, startIndex, 8); | |
- UInt64 high = (UInt32)(@value[startIndex] << 24 | | |
- @value[startIndex + 1] << 16 | | |
- @value[startIndex + 2] << 8 | | |
- @value[startIndex + 3]); | |
- UInt64 low = (UInt32)(@value[startIndex + 4] << 24 | | |
- @value[startIndex + 5] << 16 | | |
- @value[startIndex + 6] << 8 | | |
- @value[startIndex + 7]); | |
+ UInt64 high = (UInt32)( | |
+ (@value[startIndex] << 24) | | |
+ (@value[startIndex + 1] << 16) | | |
+ (@value[startIndex + 2] << 8) | | |
+ @value[startIndex + 3] | |
+ ); | |
+ UInt64 low = (UInt32)( | |
+ (@value[startIndex + 4] << 24) | | |
+ (@value[startIndex + 5] << 16) | | |
+ (@value[startIndex + 6] << 8) | | |
+ (@value[startIndex + 7]) | |
+ ); | |
- return high << 32 | low; | |
+ return (high << 32) | low; | |
} | |
[CLSCompliant(false)] | |
@@ -265,20 +244,9 @@ namespace Smdn.IO.Binary { | |
? ToUInt48LE(@value, startIndex) | |
: ToUInt48BE(@value, startIndex); | |
- public static void GetBytesLE(Int16 @value, byte[] bytes, int startIndex) | |
- { | |
- GetBytesLE(unchecked((UInt16)@value), bytes, startIndex); | |
- } | |
- | |
- public static void GetBytesBE(Int16 @value, byte[] bytes, int startIndex) | |
- { | |
- GetBytesBE(unchecked((UInt16)@value), bytes, startIndex); | |
- } | |
- | |
- public static void GetBytes(Int16 @value, bool asLittleEndian, byte[] bytes, int startIndex) | |
- { | |
- GetBytes(unchecked((UInt16)@value), asLittleEndian, bytes, startIndex); | |
- } | |
+ public static void GetBytesLE(Int16 @value, byte[] bytes, int startIndex) => GetBytesLE(unchecked((UInt16)@value), bytes, startIndex); | |
+ public static void GetBytesBE(Int16 @value, byte[] bytes, int startIndex) => GetBytesBE(unchecked((UInt16)@value), bytes, startIndex); | |
+ public static void GetBytes(Int16 @value, bool asLittleEndian, byte[] bytes, int startIndex) => GetBytes(unchecked((UInt16)@value), asLittleEndian, bytes, startIndex); | |
[CLSCompliant(false)] | |
public static void GetBytesLE(UInt16 @value, byte[] bytes, int startIndex) | |
@@ -311,20 +279,9 @@ namespace Smdn.IO.Binary { | |
GetBytesBE(@value, bytes, startIndex); | |
} | |
- public static void GetBytesLE(Int32 @value, byte[] bytes, int startIndex) | |
- { | |
- GetBytesLE(unchecked((UInt32)@value), bytes, startIndex); | |
- } | |
- | |
- public static void GetBytesBE(Int32 @value, byte[] bytes, int startIndex) | |
- { | |
- GetBytesBE(unchecked((UInt32)@value), bytes, startIndex); | |
- } | |
- | |
- public static void GetBytes(Int32 @value, bool asLittleEndian, byte[] bytes, int startIndex) | |
- { | |
- GetBytes(unchecked((UInt32)@value), asLittleEndian, bytes, startIndex); | |
- } | |
+ public static void GetBytesLE(Int32 @value, byte[] bytes, int startIndex) => GetBytesLE(unchecked((UInt32)@value), bytes, startIndex); | |
+ public static void GetBytesBE(Int32 @value, byte[] bytes, int startIndex) => GetBytesBE(unchecked((UInt32)@value), bytes, startIndex); | |
+ public static void GetBytes(Int32 @value, bool asLittleEndian, byte[] bytes, int startIndex) => GetBytes(unchecked((UInt32)@value), asLittleEndian, bytes, startIndex); | |
[CLSCompliant(false)] | |
public static void GetBytesLE(UInt32 @value, byte[] bytes, int startIndex) | |
@@ -361,20 +318,9 @@ namespace Smdn.IO.Binary { | |
GetBytesBE(@value, bytes, startIndex); | |
} | |
- public static void GetBytesLE(Int64 @value, byte[] bytes, int startIndex) | |
- { | |
- GetBytesLE(unchecked((UInt64)@value), bytes, startIndex); | |
- } | |
- | |
- public static void GetBytesBE(Int64 @value, byte[] bytes, int startIndex) | |
- { | |
- GetBytesBE(unchecked((UInt64)@value), bytes, startIndex); | |
- } | |
- | |
- public static void GetBytes(Int64 @value, bool asLittleEndian, byte[] bytes, int startIndex) | |
- { | |
- GetBytes(unchecked((UInt64)@value), asLittleEndian, bytes, startIndex); | |
- } | |
+ public static void GetBytesLE(Int64 @value, byte[] bytes, int startIndex) => GetBytesLE(unchecked((UInt64)@value), bytes, startIndex); | |
+ public static void GetBytesBE(Int64 @value, byte[] bytes, int startIndex) => GetBytesBE(unchecked((UInt64)@value), bytes, startIndex); | |
+ public static void GetBytes(Int64 @value, bool asLittleEndian, byte[] bytes, int startIndex) => GetBytes(unchecked((UInt64)@value), asLittleEndian, bytes, startIndex); | |
[CLSCompliant(false)] | |
public static void GetBytesLE(UInt64 @value, byte[] bytes, int startIndex) | |
@@ -718,5 +664,3 @@ namespace Smdn.IO.Binary { | |
return bytes; | |
} | |
} | |
-} | |
- | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryReader.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryReader.cs | |
index 5d3a24f4..2116cd55 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryReader.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryReader.cs | |
@@ -3,26 +3,32 @@ | |
using System; | |
using System.IO; | |
-namespace Smdn.IO.Binary { | |
+namespace Smdn.IO.Binary; | |
+ | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryReader : Smdn.IO.Binary.BinaryReaderBase { | |
- private const int defaultStorageSize = 8; | |
+ private const int DefaultStorageSize = 8; | |
+ // TODO use Memory<byte> | |
+#pragma warning disable SA1401 // Fields should be private | |
+#pragma warning disable CA1051 // Do not declare visible instance fields | |
protected readonly byte[] Storage; | |
+#pragma warning restore SA1401 | |
+#pragma warning restore CA1051 | |
public bool IsLittleEndian { get; } | |
public BinaryReader(Stream stream) | |
- : this(stream, BitConverter.IsLittleEndian, false, defaultStorageSize) | |
+ : this(stream, BitConverter.IsLittleEndian, false, DefaultStorageSize) | |
{ | |
} | |
public BinaryReader(Stream stream, bool leaveBaseStreamOpen) | |
- : this(stream, BitConverter.IsLittleEndian, leaveBaseStreamOpen, defaultStorageSize) | |
+ : this(stream, BitConverter.IsLittleEndian, leaveBaseStreamOpen, DefaultStorageSize) | |
{ | |
} | |
protected BinaryReader(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) | |
- : this(baseStream, asLittleEndian, leaveBaseStreamOpen, defaultStorageSize) | |
+ : this(baseStream, asLittleEndian, leaveBaseStreamOpen, DefaultStorageSize) | |
{ | |
} | |
@@ -117,4 +123,3 @@ namespace Smdn.IO.Binary { | |
return new FourCC(Storage, 0); | |
} | |
} | |
-} | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryReaderBase.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryReaderBase.cs | |
index ab8a5139..191eac58 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryReaderBase.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryReaderBase.cs | |
@@ -3,9 +3,10 @@ | |
using System; | |
using System.IO; | |
-using Smdn.IO; | |
+#pragma warning disable SA1121 // Use built-in type alias | |
+ | |
+namespace Smdn.IO.Binary; | |
-namespace Smdn.IO.Binary { | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryReaderBase : IDisposable { | |
public bool LeaveBaseStreamOpen { | |
@@ -17,7 +18,7 @@ namespace Smdn.IO.Binary { | |
CheckDisposed(); | |
if (stream.CanSeek) { | |
- var eos = (stream.ReadByte() < 0); | |
+ var eos = stream.ReadByte() < 0; | |
if (!eos) | |
stream.Seek(-1L, SeekOrigin.Current); | |
@@ -34,9 +35,7 @@ namespace Smdn.IO.Binary { | |
get { CheckDisposed(); return stream; } | |
} | |
- protected bool Disposed { | |
- get { return disposed; } | |
- } | |
+ protected bool Disposed { get; private set; } = false; | |
protected BinaryReaderBase(Stream baseStream, bool leaveBaseStreamOpen) | |
{ | |
@@ -49,14 +48,12 @@ namespace Smdn.IO.Binary { | |
this.leaveBaseStreamOpen = leaveBaseStreamOpen; | |
} | |
- public virtual void Close() | |
- { | |
- Dispose(true); | |
- } | |
+ public virtual void Close() => (this as IDisposable).Dispose(); | |
void IDisposable.Dispose() | |
{ | |
Dispose(true); | |
+ GC.SuppressFinalize(this); | |
} | |
protected virtual void Dispose(bool disposing) | |
@@ -68,10 +65,10 @@ namespace Smdn.IO.Binary { | |
stream = null; | |
} | |
- disposed = true; | |
+ Disposed = true; | |
} | |
- public virtual Byte ReadByte() | |
+ public virtual byte ReadByte() | |
{ | |
CheckDisposed(); | |
@@ -84,34 +81,22 @@ namespace Smdn.IO.Binary { | |
} | |
[CLSCompliant(false)] | |
- public virtual SByte ReadSByte() | |
- { | |
- return unchecked((sbyte)ReadByte()); | |
- } | |
+ public virtual SByte ReadSByte() => unchecked((sbyte)ReadByte()); | |
public abstract Int16 ReadInt16(); | |
[CLSCompliant(false)] | |
- public virtual UInt16 ReadUInt16() | |
- { | |
- return unchecked((UInt16)ReadInt16()); | |
- } | |
+ public virtual UInt16 ReadUInt16() => unchecked((UInt16)ReadInt16()); | |
public abstract Int32 ReadInt32(); | |
[CLSCompliant(false)] | |
- public virtual UInt32 ReadUInt32() | |
- { | |
- return unchecked((UInt32)ReadInt32()); | |
- } | |
+ public virtual UInt32 ReadUInt32() => unchecked((UInt32)ReadInt32()); | |
public abstract Int64 ReadInt64(); | |
[CLSCompliant(false)] | |
- public virtual UInt64 ReadUInt64() | |
- { | |
- return unchecked((UInt64)ReadInt64()); | |
- } | |
+ public virtual UInt64 ReadUInt64() => unchecked((UInt64)ReadInt64()); | |
public byte[] ReadBytes(int count) | |
{ | |
@@ -168,14 +153,10 @@ namespace Smdn.IO.Binary { | |
} | |
public int ReadBytes(byte[] buffer, int index, int count) | |
- { | |
- return ReadBytes(buffer, index, count, false); | |
- } | |
+ => ReadBytes(buffer, index, count, false); | |
public void ReadExactBytes(byte[] buffer, int index, int count) | |
- { | |
- ReadBytes(buffer, index, count, true); | |
- } | |
+ => ReadBytes(buffer, index, count, true); | |
protected int ReadBytes(byte[] buffer, int index, int count, bool readExactBytes) | |
{ | |
@@ -232,7 +213,7 @@ namespace Smdn.IO.Binary { | |
} | |
else { | |
var bufferSize = (int)Math.Min(4096L, remain); | |
- var initialCapacity = (int)Math.Min((long)int.MaxValue, remain); | |
+ var initialCapacity = (int)Math.Min(int.MaxValue, remain); | |
return stream.ReadToEnd(bufferSize, initialCapacity); | |
} | |
@@ -244,13 +225,10 @@ namespace Smdn.IO.Binary { | |
protected void CheckDisposed() | |
{ | |
- if (disposed) | |
+ if (Disposed) | |
throw new ObjectDisposedException(GetType().FullName); | |
} | |
private Stream stream; | |
private readonly bool leaveBaseStreamOpen; | |
- private bool disposed = false; | |
} | |
-} | |
- | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryWriter.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryWriter.cs | |
index 814af637..b4516ece 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryWriter.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryWriter.cs | |
@@ -3,26 +3,32 @@ | |
using System; | |
using System.IO; | |
-namespace Smdn.IO.Binary { | |
+namespace Smdn.IO.Binary; | |
+ | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class BinaryWriter : Smdn.IO.Binary.BinaryWriterBase { | |
- private const int defaultStorageSize = 8; | |
+ private const int DefaultStorageSize = 8; | |
+ // TODO use Memory<byte> | |
+#pragma warning disable SA1401 // Fields should be private | |
+#pragma warning disable CA1051 // Do not declare visible instance fields | |
protected readonly byte[] Storage; | |
+#pragma warning restore SA1401 | |
+#pragma warning restore CA1051 | |
public bool IsLittleEndian { get; } | |
public BinaryWriter(Stream stream) | |
- : this(stream, BitConverter.IsLittleEndian, false, defaultStorageSize) | |
+ : this(stream, BitConverter.IsLittleEndian, false, DefaultStorageSize) | |
{ | |
} | |
public BinaryWriter(Stream stream, bool leaveBaseStreamOpen) | |
- : this(stream, BitConverter.IsLittleEndian, leaveBaseStreamOpen, defaultStorageSize) | |
+ : this(stream, BitConverter.IsLittleEndian, leaveBaseStreamOpen, DefaultStorageSize) | |
{ | |
} | |
protected BinaryWriter(Stream baseStream, bool asLittleEndian, bool leaveBaseStreamOpen) | |
- : this(baseStream, asLittleEndian, leaveBaseStreamOpen, defaultStorageSize) | |
+ : this(baseStream, asLittleEndian, leaveBaseStreamOpen, DefaultStorageSize) | |
{ | |
} | |
@@ -117,4 +123,3 @@ namespace Smdn.IO.Binary { | |
WriteUnchecked(Storage, 0, 4); | |
} | |
} | |
-} | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryWriterBase.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryWriterBase.cs | |
index 4b217b7b..49774314 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryWriterBase.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/BinaryWriterBase.cs | |
@@ -1,11 +1,13 @@ | |
// SPDX-FileCopyrightText: 2010 smdn <smdn@smdn.jp> | |
// SPDX-License-Identifier: MIT | |
+ | |
+#pragma warning disable SA1121 // Use built-in type alias | |
+ | |
using System; | |
using System.IO; | |
-using Smdn.IO; | |
+namespace Smdn.IO.Binary; | |
-namespace Smdn.IO.Binary { | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public abstract class BinaryWriterBase : IDisposable { | |
public bool LeaveBaseStreamOpen { | |
@@ -16,9 +18,7 @@ namespace Smdn.IO.Binary { | |
get { CheckDisposed(); return stream; } | |
} | |
- protected bool Disposed { | |
- get { return disposed; } | |
- } | |
+ protected bool Disposed { get; private set; } = false; | |
protected BinaryWriterBase(Stream baseStream, bool leaveBaseStreamOpen) | |
{ | |
@@ -31,14 +31,12 @@ namespace Smdn.IO.Binary { | |
this.leaveBaseStreamOpen = leaveBaseStreamOpen; | |
} | |
- public virtual void Close() | |
- { | |
- Dispose(true); | |
- } | |
+ public virtual void Close() => (this as IDisposable).Dispose(); | |
void IDisposable.Dispose() | |
{ | |
Dispose(true); | |
+ GC.SuppressFinalize(this); | |
} | |
protected virtual void Dispose(bool disposing) | |
@@ -50,7 +48,7 @@ namespace Smdn.IO.Binary { | |
stream = null; | |
} | |
- disposed = true; | |
+ Disposed = true; | |
} | |
public void Flush() | |
@@ -60,40 +58,25 @@ namespace Smdn.IO.Binary { | |
stream.Flush(); | |
} | |
- public virtual void Write(Byte @value) | |
- { | |
- stream.WriteByte(@value); | |
- } | |
+ public virtual void Write(Byte @value) => stream.WriteByte(@value); | |
[CLSCompliant(false)] | |
- public virtual void Write(SByte @value) | |
- { | |
- stream.WriteByte(unchecked((byte)@value)); | |
- } | |
+ public virtual void Write(SByte @value) => stream.WriteByte(unchecked((byte)@value)); | |
public abstract void Write(Int16 @value); | |
[CLSCompliant(false)] | |
- public virtual void Write(UInt16 @value) | |
- { | |
- Write(unchecked((Int16)@value)); | |
- } | |
+ public virtual void Write(UInt16 @value) => Write(unchecked((Int16)@value)); | |
public abstract void Write(Int32 @value); | |
[CLSCompliant(false)] | |
- public virtual void Write(UInt32 @value) | |
- { | |
- Write(unchecked((Int32)@value)); | |
- } | |
+ public virtual void Write(UInt32 @value) => Write(unchecked((Int32)@value)); | |
public abstract void Write(Int64 @value); | |
[CLSCompliant(false)] | |
- public virtual void Write(UInt64 @value) | |
- { | |
- Write(unchecked((Int64)@value)); | |
- } | |
+ public virtual void Write(UInt64 @value) => Write(unchecked((Int64)@value)); | |
public void Write(byte[] buffer) | |
{ | |
@@ -139,9 +122,7 @@ namespace Smdn.IO.Binary { | |
} | |
public void WriteZero(int count) | |
- { | |
- WriteZero((long)count); | |
- } | |
+ => WriteZero((long)count); | |
public void WriteZero(long count) | |
{ | |
@@ -152,7 +133,7 @@ namespace Smdn.IO.Binary { | |
CheckDisposed(); | |
- var zeroes = new byte[Math.Min(count, 4096)]; | |
+ var zeroes = new byte[Math.Min(count, 4096)]; // TODO: array pool | |
for (; 0 < count; count -= zeroes.Length) { | |
if (zeroes.Length < count) | |
@@ -164,13 +145,10 @@ namespace Smdn.IO.Binary { | |
protected void CheckDisposed() | |
{ | |
- if (disposed) | |
+ if (Disposed) | |
throw new ObjectDisposedException(GetType().FullName); | |
} | |
private Stream stream; | |
private readonly bool leaveBaseStreamOpen; | |
- private bool disposed = false; | |
} | |
-} | |
- | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/EmptyByteArray.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/EmptyByteArray.cs | |
index 4f02ddd1..64c4b31f 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/EmptyByteArray.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/EmptyByteArray.cs | |
@@ -1,12 +1,11 @@ | |
// SPDX-FileCopyrightText: 2010 smdn <smdn@smdn.jp> | |
// SPDX-License-Identifier: MIT | |
-using System; | |
-namespace Smdn.IO.Binary { | |
+namespace Smdn.IO.Binary; | |
+ | |
#if !SYSTEM_ARRAY_EMPTY | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
internal static class EmptyByteArray { | |
public static readonly byte[] Instance = new byte[0]; | |
} | |
#endif | |
-} | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/LittleEndianBinaryReader.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/LittleEndianBinaryReader.cs | |
index e5b0ea9e..e63e7b04 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/LittleEndianBinaryReader.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/LittleEndianBinaryReader.cs | |
@@ -3,7 +3,8 @@ | |
using System; | |
using System.IO; | |
-namespace Smdn.IO.Binary { | |
+namespace Smdn.IO.Binary; | |
+ | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryReader : Smdn.IO.Binary.BinaryReader { | |
public LittleEndianBinaryReader(Stream stream) | |
@@ -80,4 +81,3 @@ namespace Smdn.IO.Binary { | |
return BinaryConversion.ToUInt48LE(Storage, 0); | |
} | |
} | |
-} | |
diff --git a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/LittleEndianBinaryWriter.cs b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/LittleEndianBinaryWriter.cs | |
index b2540bfc..9a76cc69 100644 | |
--- a/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/LittleEndianBinaryWriter.cs | |
+++ b/src/Smdn.Fundamental.Stream.BinaryReaderWriter/Smdn.IO.Binary/LittleEndianBinaryWriter.cs | |
@@ -3,7 +3,8 @@ | |
using System; | |
using System.IO; | |
-namespace Smdn.IO.Binary { | |
+namespace Smdn.IO.Binary; | |
+ | |
[System.Runtime.CompilerServices.TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] | |
public class LittleEndianBinaryWriter : Smdn.IO.Binary.BinaryWriter { | |
public LittleEndianBinaryWriter(Stream stream) | |
@@ -80,4 +81,3 @@ namespace Smdn.IO.Binary { | |
WriteUnchecked(Storage, 0, 6); | |
} | |
} | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment