Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
Add System.Buffers
Browse files Browse the repository at this point in the history
  • Loading branch information
terrajobst committed Oct 16, 2018
1 parent d24f59c commit 6d7fc68
Show file tree
Hide file tree
Showing 18 changed files with 509 additions and 6 deletions.
94 changes: 94 additions & 0 deletions netstandard/ref/System.Buffers.Binary.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Buffers.Binary
{
public static partial class BinaryPrimitives
{
public static short ReadInt16BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static short ReadInt16LittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
public static int ReadInt32BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
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; }
[System.CLSCompliantAttribute(false)]
public static ushort ReadUInt16BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ReadUInt16LittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ReadUInt32BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ReadUInt32LittleEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ReadUInt64BigEndian(System.ReadOnlySpan<byte> source) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ReadUInt64LittleEndian(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; }
public static long ReverseEndianness(long value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static sbyte ReverseEndianness(sbyte value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ushort ReverseEndianness(ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static uint ReverseEndianness(uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static ulong ReverseEndianness(ulong value) { throw null; }
public static bool TryReadInt16BigEndian(System.ReadOnlySpan<byte> source, out short value) { value = default(short); throw null; }
public static bool TryReadInt16LittleEndian(System.ReadOnlySpan<byte> source, out short value) { value = default(short); throw null; }
public static bool TryReadInt32BigEndian(System.ReadOnlySpan<byte> source, out int value) { value = default(int); throw null; }
public static bool TryReadInt32LittleEndian(System.ReadOnlySpan<byte> source, out int value) { value = default(int); throw null; }
public static bool TryReadInt64BigEndian(System.ReadOnlySpan<byte> source, out long value) { value = default(long); throw null; }
public static bool TryReadInt64LittleEndian(System.ReadOnlySpan<byte> source, out long value) { value = default(long); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt16BigEndian(System.ReadOnlySpan<byte> source, out ushort value) { value = default(ushort); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt16LittleEndian(System.ReadOnlySpan<byte> source, out ushort value) { value = default(ushort); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt32BigEndian(System.ReadOnlySpan<byte> source, out uint value) { value = default(uint); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt32LittleEndian(System.ReadOnlySpan<byte> source, out uint value) { value = default(uint); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt64BigEndian(System.ReadOnlySpan<byte> source, out ulong value) { value = default(ulong); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryReadUInt64LittleEndian(System.ReadOnlySpan<byte> source, out ulong value) { value = default(ulong); throw null; }
public static bool TryWriteInt16BigEndian(System.Span<byte> destination, short value) { throw null; }
public static bool TryWriteInt16LittleEndian(System.Span<byte> destination, short value) { throw null; }
public static bool TryWriteInt32BigEndian(System.Span<byte> destination, int value) { throw null; }
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; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUInt16BigEndian(System.Span<byte> destination, ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUInt16LittleEndian(System.Span<byte> destination, ushort value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUInt32BigEndian(System.Span<byte> destination, uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryWriteUInt32LittleEndian(System.Span<byte> destination, uint value) { throw null; }
[System.CLSCompliantAttribute(false)]
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; }
public static void WriteInt16BigEndian(System.Span<byte> destination, short value) { }
public static void WriteInt16LittleEndian(System.Span<byte> destination, short value) { }
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) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt16BigEndian(System.Span<byte> destination, ushort value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt16LittleEndian(System.Span<byte> destination, ushort value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt32BigEndian(System.Span<byte> destination, uint value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt32LittleEndian(System.Span<byte> destination, uint value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt64BigEndian(System.Span<byte> destination, ulong value) { }
[System.CLSCompliantAttribute(false)]
public static void WriteUInt64LittleEndian(System.Span<byte> destination, ulong value) { }
}
}
62 changes: 62 additions & 0 deletions netstandard/ref/System.Buffers.Text.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace System.Buffers.Text
{
public static partial class Base64
{
public static System.Buffers.OperationStatus DecodeFromUtf8(System.ReadOnlySpan<byte> utf8, System.Span<byte> bytes, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) { bytesConsumed = default(int); bytesWritten = default(int); throw null; }
public static System.Buffers.OperationStatus DecodeFromUtf8InPlace(System.Span<byte> buffer, out int bytesWritten) { bytesWritten = default(int); throw null; }
public static System.Buffers.OperationStatus EncodeToUtf8(System.ReadOnlySpan<byte> bytes, System.Span<byte> utf8, out int bytesConsumed, out int bytesWritten, bool isFinalBlock = true) { bytesConsumed = default(int); bytesWritten = default(int); throw null; }
public static System.Buffers.OperationStatus EncodeToUtf8InPlace(System.Span<byte> buffer, int dataLength, out int bytesWritten) { bytesWritten = default(int); throw null; }
public static int GetMaxDecodedFromUtf8Length(int length) { throw null; }
public static int GetMaxEncodedToUtf8Length(int length) { throw null; }
}
public static partial class Utf8Formatter
{
public static bool TryFormat(bool value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(byte value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(System.DateTime value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(System.DateTimeOffset value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(decimal value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(double value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(System.Guid value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(short value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(int value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(long value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryFormat(sbyte value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(float value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
public static bool TryFormat(System.TimeSpan value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryFormat(ushort value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryFormat(uint value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryFormat(ulong value, System.Span<byte> destination, out int bytesWritten, System.Buffers.StandardFormat format = default(System.Buffers.StandardFormat)) { bytesWritten = default(int); throw null; }
}
public static partial class Utf8Parser
{
public static bool TryParse(System.ReadOnlySpan<byte> source, out bool value, out int bytesConsumed, char standardFormat = '\0') { value = default(bool); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out byte value, out int bytesConsumed, char standardFormat = '\0') { value = default(byte); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out System.DateTime value, out int bytesConsumed, char standardFormat = '\0') { value = default(System.DateTime); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out System.DateTimeOffset value, out int bytesConsumed, char standardFormat = '\0') { value = default(System.DateTimeOffset); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out decimal value, out int bytesConsumed, char standardFormat = '\0') { value = default(decimal); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out double value, out int bytesConsumed, char standardFormat = '\0') { value = default(double); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out System.Guid value, out int bytesConsumed, char standardFormat = '\0') { value = default(System.Guid); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out short value, out int bytesConsumed, char standardFormat = '\0') { value = default(short); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out int value, out int bytesConsumed, char standardFormat = '\0') { value = default(int); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out long value, out int bytesConsumed, char standardFormat = '\0') { value = default(long); bytesConsumed = default(int); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryParse(System.ReadOnlySpan<byte> source, out sbyte value, out int bytesConsumed, char standardFormat = '\0') { value = default(sbyte); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out float value, out int bytesConsumed, char standardFormat = '\0') { value = default(float); bytesConsumed = default(int); throw null; }
public static bool TryParse(System.ReadOnlySpan<byte> source, out System.TimeSpan value, out int bytesConsumed, char standardFormat = '\0') { value = default(System.TimeSpan); bytesConsumed = default(int); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryParse(System.ReadOnlySpan<byte> source, out ushort value, out int bytesConsumed, char standardFormat = '\0') { value = default(ushort); bytesConsumed = default(int); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryParse(System.ReadOnlySpan<byte> source, out uint value, out int bytesConsumed, char standardFormat = '\0') { value = default(uint); bytesConsumed = default(int); throw null; }
[System.CLSCompliantAttribute(false)]
public static bool TryParse(System.ReadOnlySpan<byte> source, out ulong value, out int bytesConsumed, char standardFormat = '\0') { value = default(ulong); bytesConsumed = default(int); throw null; }
}
}
Loading

0 comments on commit 6d7fc68

Please sign in to comment.