diff --git a/Example1/AudioStreamer.cs b/Example1/AudioStreamer.cs index ec410feb..d2849b5b 100644 --- a/Example1/AudioStreamer.cs +++ b/Example1/AudioStreamer.cs @@ -165,15 +165,15 @@ namespace Example1 int ch_num = buffer_array.GetLength(0); int buffer_length = buffer_array.GetLength(1); - msg.AddRange(user_id.ToByteArray(ByteOrder.BIG)); + msg.AddRange(user_id.ToByteArray(ByteOrder.Big)); msg.Add((byte)ch_num); - msg.AddRange(((uint)buffer_length).ToByteArray(ByteOrder.BIG)); + msg.AddRange(((uint)buffer_length).ToByteArray(ByteOrder.Big)); ch_num.Times(i => { buffer_length.Times(j => { - msg.AddRange(buffer_array[i, j].ToByteArray(ByteOrder.BIG)); + msg.AddRange(buffer_array[i, j].ToByteArray(ByteOrder.Big)); }); }); @@ -195,9 +195,9 @@ namespace Example1 private AudioMessage parseAudioMessage(byte[] data) { - uint user_id = data.SubArray(0, 4).To(ByteOrder.BIG); + uint user_id = data.SubArray(0, 4).To(ByteOrder.Big); byte ch_num = data.SubArray(4, 1)[0]; - uint buffer_length = data.SubArray(5, 4).To(ByteOrder.BIG); + uint buffer_length = data.SubArray(5, 4).To(ByteOrder.Big); float[,] buffer_array = new float[ch_num, buffer_length]; int offset = 9; @@ -205,7 +205,7 @@ namespace Example1 { buffer_length.Times(j => { - buffer_array[i, j] = data.SubArray(offset, 4).To(ByteOrder.BIG); + buffer_array[i, j] = data.SubArray(offset, 4).To(ByteOrder.Big); offset += 4; }); }); diff --git a/websocket-sharp/ByteOrder.cs b/websocket-sharp/ByteOrder.cs index 6a60287c..dada91d0 100644 --- a/websocket-sharp/ByteOrder.cs +++ b/websocket-sharp/ByteOrder.cs @@ -4,8 +4,8 @@ * * The MIT License * - * Copyright (c) 2012-2013 sta.blockhead - * + * Copyright (c) 2012-2014 sta.blockhead + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights @@ -15,7 +15,7 @@ * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -38,10 +38,10 @@ namespace WebSocketSharp { /// /// Indicates a Little-endian. /// - LITTLE, + Little, /// /// Indicates a Big-endian. /// - BIG + Big } } diff --git a/websocket-sharp/CloseEventArgs.cs b/websocket-sharp/CloseEventArgs.cs index aea038bf..0933f1cf 100644 --- a/websocket-sharp/CloseEventArgs.cs +++ b/websocket-sharp/CloseEventArgs.cs @@ -113,7 +113,7 @@ namespace WebSocketSharp private static ushort getCodeFrom (byte [] data) { return data.Length > 1 - ? data.SubArray (0, 2).ToUInt16 (ByteOrder.BIG) + ? data.SubArray (0, 2).ToUInt16 (ByteOrder.Big) : (ushort) CloseStatusCode.NO_STATUS_CODE; } diff --git a/websocket-sharp/Ext.cs b/websocket-sharp/Ext.cs index 54874b74..35667e92 100644 --- a/websocket-sharp/Ext.cs +++ b/websocket-sharp/Ext.cs @@ -173,7 +173,7 @@ namespace WebSocketSharp internal static byte [] Append (this ushort code, string reason) { using (var buffer = new MemoryStream ()) { - var tmp = code.ToByteArrayInternally (ByteOrder.BIG); + var tmp = code.ToByteArrayInternally (ByteOrder.Big); buffer.Write (tmp, 0, 2); if (reason != null && reason.Length > 0) { tmp = Encoding.UTF8.GetBytes (reason); @@ -1277,7 +1277,7 @@ namespace WebSocketSharp { // true : !(true ^ true) or !(false ^ false) // false: !(true ^ false) or !(false ^ true) - return !(BitConverter.IsLittleEndian ^ (order == ByteOrder.LITTLE)); + return !(BitConverter.IsLittleEndian ^ (order == ByteOrder.Little)); } /// diff --git a/websocket-sharp/PayloadData.cs b/websocket-sharp/PayloadData.cs index 8816fe0c..e6dac574 100644 --- a/websocket-sharp/PayloadData.cs +++ b/websocket-sharp/PayloadData.cs @@ -88,7 +88,7 @@ namespace WebSocketSharp internal bool ContainsReservedCloseStatusCode { get { return ApplicationData.Length > 1 - ? ApplicationData.SubArray (0, 2).ToUInt16 (ByteOrder.BIG).IsReserved () + ? ApplicationData.SubArray (0, 2).ToUInt16 (ByteOrder.Big).IsReserved () : false; } } diff --git a/websocket-sharp/Server/HttpServer.cs b/websocket-sharp/Server/HttpServer.cs index 877023a4..723e83c8 100644 --- a/websocket-sharp/Server/HttpServer.cs +++ b/websocket-sharp/Server/HttpServer.cs @@ -410,7 +410,7 @@ namespace WebSocketSharp.Server } _services.Stop ( - ((ushort) CloseStatusCode.SERVER_ERROR).ToByteArrayInternally (ByteOrder.BIG), true); + ((ushort) CloseStatusCode.SERVER_ERROR).ToByteArrayInternally (ByteOrder.Big), true); _listener.Abort (); _state = ServerState.Stop; diff --git a/websocket-sharp/Server/WebSocketServer.cs b/websocket-sharp/Server/WebSocketServer.cs index 6aa0caa7..bf49c8ce 100644 --- a/websocket-sharp/Server/WebSocketServer.cs +++ b/websocket-sharp/Server/WebSocketServer.cs @@ -466,7 +466,7 @@ namespace WebSocketSharp.Server _listener.Stop (); _services.Stop ( - ((ushort) CloseStatusCode.SERVER_ERROR).ToByteArrayInternally (ByteOrder.BIG), true); + ((ushort) CloseStatusCode.SERVER_ERROR).ToByteArrayInternally (ByteOrder.Big), true); _state = ServerState.Stop; } diff --git a/websocket-sharp/Server/WebSocketServiceManager.cs b/websocket-sharp/Server/WebSocketServiceManager.cs index dcec6f3c..84629386 100644 --- a/websocket-sharp/Server/WebSocketServiceManager.cs +++ b/websocket-sharp/Server/WebSocketServiceManager.cs @@ -295,7 +295,7 @@ namespace WebSocketSharp.Server if (host.Sessions.State == ServerState.Start) host.Sessions.Stop ( - ((ushort) CloseStatusCode.AWAY).ToByteArrayInternally (ByteOrder.BIG), true); + ((ushort) CloseStatusCode.AWAY).ToByteArrayInternally (ByteOrder.Big), true); return true; } diff --git a/websocket-sharp/WsFrame.cs b/websocket-sharp/WsFrame.cs index e21bd3ee..c10b7510 100644 --- a/websocket-sharp/WsFrame.cs +++ b/websocket-sharp/WsFrame.cs @@ -102,8 +102,8 @@ namespace WebSocketSharp ExtPayloadLen = payloadLen < 126 ? new byte []{} : payloadLen == 126 - ? ((ushort) dataLen).ToByteArrayInternally (ByteOrder.BIG) - : dataLen.ToByteArrayInternally (ByteOrder.BIG); + ? ((ushort) dataLen).ToByteArrayInternally (ByteOrder.Big) + : dataLen.ToByteArrayInternally (ByteOrder.Big); /* MaskingKey */ @@ -451,8 +451,8 @@ namespace WebSocketSharp ulong dataLen = payloadLen < 126 ? payloadLen : payloadLen == 126 - ? extPayloadLen.ToUInt16 (ByteOrder.BIG) - : extPayloadLen.ToUInt64 (ByteOrder.BIG); + ? extPayloadLen.ToUInt16 (ByteOrder.Big) + : extPayloadLen.ToUInt64 (ByteOrder.Big); byte [] data = null; if (dataLen > 0) @@ -502,9 +502,9 @@ namespace WebSocketSharp var ext = frame.ExtPayloadLen; var size = ext.Length; var extLen = size == 2 - ? ext.ToUInt16 (ByteOrder.BIG).ToString () + ? ext.ToUInt16 (ByteOrder.Big).ToString () : size == 8 - ? ext.ToUInt64 (ByteOrder.BIG).ToString () + ? ext.ToUInt64 (ByteOrder.Big).ToString () : String.Empty; /* Masking Key */ @@ -677,7 +677,7 @@ Extended Payload Len: {7} header = (header << 4) + (int) Opcode; header = (header << 1) + (int) Mask; header = (header << 7) + (int) PayloadLen; - buffer.Write (((ushort) header).ToByteArrayInternally (ByteOrder.BIG), 0, 2); + buffer.Write (((ushort) header).ToByteArrayInternally (ByteOrder.Big), 0, 2); if (PayloadLen > 125) buffer.Write (ExtPayloadLen, 0, ExtPayloadLen.Length);