Modified ByteOrder enum values to PascalCase values

This commit is contained in:
sta 2014-02-28 17:17:44 +09:00
parent 2e853fca63
commit 46fc6f927f
9 changed files with 25 additions and 25 deletions

View File

@ -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<uint>(ByteOrder.BIG);
uint user_id = data.SubArray(0, 4).To<uint>(ByteOrder.Big);
byte ch_num = data.SubArray(4, 1)[0];
uint buffer_length = data.SubArray(5, 4).To<uint>(ByteOrder.BIG);
uint buffer_length = data.SubArray(5, 4).To<uint>(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<float>(ByteOrder.BIG);
buffer_array[i, j] = data.SubArray(offset, 4).To<float>(ByteOrder.Big);
offset += 4;
});
});

View File

@ -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 {
/// <summary>
/// Indicates a Little-endian.
/// </summary>
LITTLE,
Little,
/// <summary>
/// Indicates a Big-endian.
/// </summary>
BIG
Big
}
}

View File

@ -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;
}

View File

@ -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));
}
/// <summary>

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);