Skip to content

Commit

Permalink
Expose missing BinaryPrimitives APIs (#82310)
Browse files Browse the repository at this point in the history
* Expose missing BinaryPrimitives APIs

* Fix the BinaryPrimitives doc comments to match the actual documentation

* Use newer BinaryPrimitives APIs where applicable
  • Loading branch information
tannergooding authored Feb 21, 2023
1 parent 9507a9c commit 2819a94
Show file tree
Hide file tree
Showing 8 changed files with 886 additions and 85 deletions.
48 changes: 48 additions & 0 deletions src/libraries/System.Memory/ref/System.Memory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,10 @@ public static partial class BinaryPrimitives
public static int ReadInt32LittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static long ReadInt64BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static long ReadInt64LittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static System.Int128 ReadInt128BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static System.Int128 ReadInt128LittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static nint ReadIntPtrBigEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static nint ReadIntPtrLittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static float ReadSingleBigEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static float ReadSingleLittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
Expand All @@ -452,6 +456,14 @@ public static partial class BinaryPrimitives
public static ulong ReadUInt64BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ReadUInt64LittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.UInt128 ReadUInt128BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static System.UInt128 ReadUInt128LittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint ReadUIntPtrBigEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static nuint ReadUIntPtrLittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static byte ReverseEndianness(byte value) { throw null; }
public static short ReverseEndianness(short value) { throw null; }
public static int ReverseEndianness(int value) { throw null; }
Expand Down Expand Up @@ -495,6 +507,10 @@ public static void ReverseEndianness(System.ReadOnlySpan<ushort> source, System.
public static bool TryReadInt32LittleEndian(System.ReadOnlySpan<byte> source, out int value) { throw null; }
public static bool TryReadInt64BigEndian(System.ReadOnlySpan<byte> source, out long value) { throw null; }
public static bool TryReadInt64LittleEndian(System.ReadOnlySpan<byte> source, out long value) { throw null; }
public static bool TryReadInt128BigEndian(System.ReadOnlySpan<byte> source, out System.Int128 value) { throw null; }
public static bool TryReadInt128LittleEndian(System.ReadOnlySpan<byte> source, out System.Int128 value) { throw null; }
public static bool TryReadIntPtrBigEndian(System.ReadOnlySpan<byte> source, out nint value) { throw null; }
public static bool TryReadIntPtrLittleEndian(System.ReadOnlySpan<byte> source, out nint value) { throw null; }
public static bool TryReadSingleBigEndian(System.ReadOnlySpan<byte> source, out float value) { throw null; }
public static bool TryReadSingleLittleEndian(System.ReadOnlySpan<byte> source, out float value) { throw null; }
[System.CLSCompliantAttribute(false)]
Expand All @@ -509,6 +525,14 @@ public static void ReverseEndianness(System.ReadOnlySpan<ushort> source, System.
public static bool TryReadUInt64BigEndian(System.ReadOnlySpan<byte> source, out ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt64LittleEndian(System.ReadOnlySpan<byte> source, out ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt128BigEndian(System.ReadOnlySpan<byte> source, out System.UInt128 value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt128LittleEndian(System.ReadOnlySpan<byte> source, out System.UInt128 value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUIntPtrBigEndian(System.ReadOnlySpan<byte> source, out nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUIntPtrLittleEndian(System.ReadOnlySpan<byte> source, out nuint value) { throw null; }
public static bool TryWriteDoubleBigEndian(System.Span<byte> destination, double value) { throw null; }
public static bool TryWriteDoubleLittleEndian(System.Span<byte> destination, double value) { throw null; }
public static bool TryWriteHalfBigEndian(System.Span<byte> destination, System.Half value) { throw null; }
Expand All @@ -519,6 +543,10 @@ public static void ReverseEndianness(System.ReadOnlySpan<ushort> source, System.
public static bool TryWriteInt32LittleEndian(System.Span<byte> destination, int value) { throw null; }
public static bool TryWriteInt64BigEndian(System.Span<byte> destination, long value) { throw null; }
public static bool TryWriteInt64LittleEndian(System.Span<byte> destination, long value) { throw null; }
public static bool TryWriteInt128BigEndian(System.Span<byte> destination, System.Int128 value) { throw null; }
public static bool TryWriteInt128LittleEndian(System.Span<byte> destination, System.Int128 value) { throw null; }
public static bool TryWriteIntPtrBigEndian(System.Span<byte> destination, nint value) { throw null; }
public static bool TryWriteIntPtrLittleEndian(System.Span<byte> destination, nint value) { throw null; }
public static bool TryWriteSingleBigEndian(System.Span<byte> destination, float value) { throw null; }
public static bool TryWriteSingleLittleEndian(System.Span<byte> destination, float value) { throw null; }
[System.CLSCompliantAttribute(false)]
Expand All @@ -533,6 +561,14 @@ public static void ReverseEndianness(System.ReadOnlySpan<ushort> source, System.
public static bool TryWriteUInt64BigEndian(System.Span<byte> destination, ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUInt64LittleEndian(System.Span<byte> destination, ulong value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUInt128BigEndian(System.Span<byte> destination, System.UInt128 value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUInt128LittleEndian(System.Span<byte> destination, System.UInt128 value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUIntPtrBigEndian(System.Span<byte> destination, nuint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUIntPtrLittleEndian(System.Span<byte> destination, nuint value) { throw null; }
public static void WriteDoubleBigEndian(System.Span<byte> destination, double value) { }
public static void WriteDoubleLittleEndian(System.Span<byte> destination, double value) { }
public static void WriteHalfBigEndian(System.Span<byte> destination, System.Half value) { }
Expand All @@ -543,6 +579,10 @@ public static void WriteInt32BigEndian(System.Span<byte> destination, int value)
public static void WriteInt32LittleEndian(System.Span<byte> destination, int value) { }
public static void WriteInt64BigEndian(System.Span<byte> destination, long value) { }
public static void WriteInt64LittleEndian(System.Span<byte> destination, long value) { }
public static void WriteInt128BigEndian(System.Span<byte> destination, System.Int128 value) { }
public static void WriteInt128LittleEndian(System.Span<byte> destination, System.Int128 value) { }
public static void WriteIntPtrBigEndian(System.Span<byte> destination, nint value) { }
public static void WriteIntPtrLittleEndian(System.Span<byte> destination, nint value) { }
public static void WriteSingleBigEndian(System.Span<byte> destination, float value) { }
public static void WriteSingleLittleEndian(System.Span<byte> destination, float value) { }
[System.CLSCompliantAttribute(false)]
Expand All @@ -557,6 +597,14 @@ public static void WriteUInt32LittleEndian(System.Span<byte> destination, uint v
public static void WriteUInt64BigEndian(System.Span<byte> destination, ulong value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt64LittleEndian(System.Span<byte> destination, ulong value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt128BigEndian(System.Span<byte> destination, System.UInt128 value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt128LittleEndian(System.Span<byte> destination, System.UInt128 value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUIntPtrBigEndian(System.Span<byte> destination, nuint value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUIntPtrLittleEndian(System.Span<byte> destination, nuint value) { }
}
}
namespace System.Buffers.Text
Expand Down
Loading

0 comments on commit 2819a94

Please sign in to comment.