From d8583535c86d453e225b17d757fc2fe94eefdaff Mon Sep 17 00:00:00 2001 From: David Fowler Date: Tue, 6 Jun 2017 10:58:29 -0700 Subject: [PATCH] Remove unused code --- .../Internal/Formatters/MessageFormatUtils.cs | 31 ------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.SignalR.Common/Internal/Formatters/MessageFormatUtils.cs diff --git a/src/Microsoft.AspNetCore.SignalR.Common/Internal/Formatters/MessageFormatUtils.cs b/src/Microsoft.AspNetCore.SignalR.Common/Internal/Formatters/MessageFormatUtils.cs deleted file mode 100644 index 1b317a0d6a..0000000000 --- a/src/Microsoft.AspNetCore.SignalR.Common/Internal/Formatters/MessageFormatUtils.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Binary.Base64; -using System.Buffers; - -namespace Microsoft.AspNetCore.Sockets.Internal.Formatters -{ - internal static class MessageFormatUtils - { - public static byte[] DecodePayload(byte[] inputPayload) - { - if (inputPayload.Length > 0) - { - // Determine the output size - var decodedLength = Base64Decoder.ComputeDecodedLength(inputPayload); - - // Allocate a new buffer to decode to - var decodeBuffer = new byte[decodedLength]; - if (Base64.Decoder.Transform(inputPayload, decodeBuffer, out _, out var _) != TransformationStatus.Done) - { - throw new FormatException("Invalid Base64 payload"); - } - return decodeBuffer; - } - - return inputPayload; - } - } -}