using System.Collections.Generic;
namespace SocketServer
{
public class BinaryPacket
{
private List
private uint bitIndex = 0;
private uint packetErrors = 0;
//Constructor
public BinaryPacket()
{
bitIndex = 0;
buffer = new List
}
public BinaryPacket(byte[] buffer_)
{
bitIndex = 0;
buffer = new List
}
//WRITE FUNCTIONS
//Writes an Event ID
public void WriteEventID(uint value)
{
WriteDynamicUnsignedNbitInteger(value, 6);
}
//Writes a single bit either 0 or 1 onto the buffer
public void WriteBoolean(Boolean value)
{
while ((int)((bitIndex + 8) / 8) > buffer.Count) buffer.Add(new byte());
buffer[(int)(bitIndex / 8)] |= (byte)((value == true ? 1 : 0) << (int)(7 - (bitIndex) % 8)); ++bitIndex; } //Writes an 8 bit unsigned byte onto the buffer public void WriteUnsignedByte(byte value) { uint dataTypeSize = 1;//byte size while ((int)((bitIndex + dataTypeSize * 8) / 8) >= buffer.Count) buffer.Add(new byte());
for (uint copyBits = 0; copyBits <>> (int)((dataTypeSize * 8 - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += dataTypeSize * 8; } //Writes an 8 bit signed byte onto the buffer public void WriteSignedByte(sbyte value) { uint dataTypeSize = 1;//byte size while ((int)((bitIndex + dataTypeSize * 8) / 8) >= buffer.Count) buffer.Add(new byte());
for (uint copyBits = 0; copyBits <>> (int)((dataTypeSize * 8 - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += dataTypeSize * 8; } //Writes a 16 bit unsigned short onto the buffer public void WriteUnsignedShort(ushort value) { uint dataTypeSize = 2;//byte size while ((int)((bitIndex + dataTypeSize * 8) / 8) >= buffer.Count) buffer.Add(new byte());
for (uint copyBits = 0; copyBits <>> (int)((dataTypeSize * 8 - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += dataTypeSize * 8; } //Writes a 16 bit signed short onto the buffer public void WriteSignedShort(short value) { uint dataTypeSize = 2;//byte size while ((int)((bitIndex + dataTypeSize * 8) / 8) >= buffer.Count) buffer.Add(new byte());
for (uint copyBits = 0; copyBits <>> (int)((dataTypeSize * 8 - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += dataTypeSize * 8; } //Writes a 32 bit unsigned integer onto the buffer public void WriteUnsignedInt(uint value) { uint dataTypeSize = 4;//byte size while ((int)((bitIndex + dataTypeSize * 8) / 8) >= buffer.Count) buffer.Add(new byte());
for (uint copyBits = 0; copyBits <>> (int)((dataTypeSize * 8 - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += dataTypeSize * 8; } //Writes a 32 bit signed integer onto the buffer public void WriteSignedInt(int value) { uint dataTypeSize = 4;//byte size while ((int)((bitIndex + dataTypeSize * 8) / 8) >= buffer.Count) buffer.Add(new byte());
for (uint copyBits = 0; copyBits <>> (int)((dataTypeSize * 8 - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += dataTypeSize * 8; } //Writes an n bit unsigned integer onto the buffer public void WriteCustomUnsignedInteger(uint value, uint bits) { while ((int)((bitIndex + bits) / 8) >= buffer.Count) buffer.Add(new byte());
for (uint copyBits = 0; copyBits <>> (int)((bits - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += bits; } //Writes an n bit signed integer onto the buffer public void WriteCustomSignedInteger(int value, uint bits) { while ((int)((bitIndex + bits) / 8) >= buffer.Count) buffer.Add(new byte());
for (uint copyBits = 0; copyBits <>> (int)((bits - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += bits; } //Writes a 32 bit floating point number onto the buffer public void WriteFloat(float value) { WriteUnsignedInt(BitConverter.ToUInt32(BitConverter.GetBytes(value), 0)); } //Writes a 64 bit floating point number onto the buffer public void WriteDouble(double value) { byte[] bytes = BitConverter.GetBytes(value); WriteUnsignedInt(BitConverter.ToUInt32(bytes, 0)); WriteUnsignedInt(BitConverter.ToUInt32(bytes, 4)); } //Writes a number by writing intervals of 2^arrayBitInterval-1, the value on the interval of bits equal to 2^arrayBitInterval means to look onto the next interval //Example, let arrayBitInterval = 4 and value = 100, 2^4-1 is 15, so 100 % 15 is 6 sets of 4 bits set to 1111 with 10 left over so 1010 would be the 7th set. Good for small values that rarely go over 2^arrayBitInterval-1 public void WriteDynamicUnsignedInteger(uint value, uint arrayBitInterval) { uint interval = (uint)((0x1 << (int)arrayBitInterval) - 1); uint intervalCount = (uint)(Math.Floor((double)(value / interval))); uint copyBits; for (uint copyInterval = 0; copyInterval < copybits =" 0;">= buffer.Count) buffer.Add(new byte());
buffer[(int)((bitIndex + copyBits) / 8)] |= (byte)(0x1 << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += arrayBitInterval; } value -= intervalCount * interval; for (copyBits = 0; copyBits <>= buffer.Count) buffer.Add(new byte());
buffer[(int)((bitIndex + copyBits) / 8)] |= (byte)(((value >> (int)((arrayBitInterval - 1) - copyBits)) & 0x1) << (int)(7 - (bitIndex + copyBits) % 8)); } bitIndex += arrayBitInterval; } //Writes a number by writing intervals of 2^arrayBitInterval-1, the value on the interval of bits equal to 2^arrayBitInterval means to look onto the next interval //The sign is copied first as 0 is negative and 1 is positive. The value is then copied as the absolute value //Example, let arrayBitInterval = 4 and value = -100, 2^4-1 is 15, so 100 % 15 is 6 sets of 4 bits set to 1111 with 10 left over so 1010 would be the 7th set. Good for small values that rarely go over 2^arrayBitInterval-1, a 0 bit is copied first public void WriteDynamicSignedInteger(int value, uint arrayBitInterval) { WriteBoolean(value > 0 ? true : false);
WriteDynamicUnsignedInteger((uint)Math.Abs(value), arrayBitInterval);
}
//Writes the number of bits and an extra bit to tell to go onto the next sequence of bits.
//In this way the bits for a number are broken up. Smaller numbers take up less space
public void WriteDynamicUnsignedNbitInteger(uint value, uint bits)
{
uint offset = 0;
uint copyBits;
for (copyBits = 0; (copyBits - offset <>= buffer.Count) buffer.Add(new byte());
buffer[(int)((bitIndex + copyBits + offset) / 8)] |= (byte)(((value >> (int)copyBits) & 0x1) << (byte)(7 - (bitIndex + copyBits + offset) % 8)); //trace("bit-" + (bitIndex+copyBits+offset) + " = " + ((value >> copyBits) & 0x1));
if ((copyBits + 1) % (bits) == 0 && copyBits != 0)
{
offset++;
while ((int)((bitIndex + copyBits + offset) / 8) >= buffer.Count) buffer.Add(new byte());
//if ((uint)(0x1 << (int)(copyBits + 1)) - 1 < poweroftwo =" (uint)(copyBits"> 0 ? true : false);
WriteDynamicUnsignedNbitInteger((uint)Math.Abs(value), bits);
}
public void WriteDynamicSignedNbitInteger(int value)
{
WriteDynamicSignedNbitInteger(value, 4);
}
//Creates a value for the ratio value/2^bitResolution-1 in relationship to value/(max-min)
//This allows a floating point to have a resolution
public void WriteCustomResolutionFloat(float min, float max, float value, uint bitResolution)
{
WriteCustomUnsignedInteger((uint)Math.Round((value - min) / (max - min) * (float)((0x1 << (int)bitResolution) - 1)), bitResolution); } //Creates a value for the ratio value/2^bitResolution-1 in relationship to value/(max-min) //This allows a floating point to have a resolution public void WriteCustomResolutionDouble(double min, double max, double value, uint bitResolution) { WriteCustomUnsignedInteger((uint)Math.Round((value - min) / (max - min) * (Double)((0x1 << (int)bitResolution) - 1)), bitResolution); } //Writes the length of the string using WriteDynamicUnsignedNbitInteger and then writes 7 bit characters using the ascii values 0-126 public void WriteString(string value, uint arrayBits) { uint size = (uint)value.Length; uint tempValue = 0; WriteDynamicUnsignedNbitInteger(size, arrayBits); for (int stringItr = 0; stringItr < tempvalue =" (uint)(value[stringItr])">= 0 && tempValue <= 128) { WriteCustomUnsignedInteger(tempValue, 7); } } } public void WriteString(string value) { WriteString(value, 4); } //WRITE FUNCTIONS - ARRAYS //Writes an array with a size written with a WriteDynamicUnsignedNbitInteger before the unsigned integers public void WriteUnsignedCustomIntegerArray(List
{//arrayBitInterval means that for value < size =" (uint)value.Count;" cyclearray =" 0;"> value, uint bits, uint arrayBits)
{//arrayBitInterval means that for value < size =" (uint)value.Count;" cyclearray =" 0;"> value, uint arrayBits)
{
uint size = (uint)value.Count;
WriteDynamicUnsignedNbitInteger(size, arrayBits);
for (int cycleArray = 0; cycleArray <> value, uint arrayBits)
{
uint size = (uint)value.Count;
WriteDynamicUnsignedNbitInteger(size, arrayBits);
for (int cycleArray = 0; cycleArray <> value, uint bitResolution, uint arrayBits)
{
uint size = (uint)value.Count;
WriteDynamicUnsignedNbitInteger(size, arrayBits);
for (int cycleArray = 0; cycleArray <> value, uint bitResolution, uint arrayBits)
{
uint size = (uint)value.Count;
WriteDynamicUnsignedNbitInteger(size, arrayBits);
for (int cycleArray = 0; cycleArray <> value, uint bits, uint arrayBits)
{
uint sizeBitIndex = bitIndex;
uint size = 0;
bitIndex += arrayBits;
foreach (KeyValuePair
{
WriteString(kvp.Key, 5);
WriteCustomUnsignedInteger(kvp.Value, bits);
size++;
}
uint tempBitIndex = bitIndex;
bitIndex = sizeBitIndex;
WriteCustomUnsignedInteger(size, arrayBits);
bitIndex = tempBitIndex;
}
//bits is the the number of bits for the unsigned integer and arrayBits sets the maximum element size 2^arrayBits
public void WriteAssociativeArrayStringToSignedInteger(Dictionary
{
uint sizeBitIndex = bitIndex;
uint size = 0;
bitIndex += arrayBits;
foreach (KeyValuePair
{
WriteString(kvp.Key, 5);
WriteCustomSignedInteger(kvp.Value, bits);
size++;
}
uint tempBitIndex = bitIndex;
bitIndex = sizeBitIndex;
WriteCustomUnsignedInteger(size, arrayBits);
bitIndex = tempBitIndex;
}
//arrayBits sets the maximum element size 2^arrayBits
public void WriteAssociativeArrayStringToFloat(Dictionary
{
uint sizeBitIndex = bitIndex;
uint size = 0;
bitIndex += arrayBits;
foreach (KeyValuePair
{
WriteString(kvp.Key, 5);
WriteFloat(kvp.Value);
size++;
}
uint tempBitIndex = bitIndex;
bitIndex = sizeBitIndex;
WriteCustomUnsignedInteger(size, arrayBits);
bitIndex = tempBitIndex;
}
//arrayBits sets the maximum element size 2^arrayBits
public void WriteAssociativeArrayStringToDouble(Dictionary
{
uint sizeBitIndex = bitIndex;
uint size = 0;
bitIndex += arrayBits;
foreach (KeyValuePair
{
WriteString(kvp.Key, 5);
WriteDouble(kvp.Value);
size++;
}
uint tempBitIndex = bitIndex;
bitIndex = sizeBitIndex;
WriteCustomUnsignedInteger(size, arrayBits);
bitIndex = tempBitIndex;
}
//arrayBits sets the maximum element size 2^arrayBits
public void WriteAssociativeArrayStringToString(Dictionary
{
uint sizeBitIndex = bitIndex;
uint size = 0;
bitIndex += arrayBits;
foreach (KeyValuePair
{
WriteString(kvp.Key, 5);
WriteString(kvp.Value, 5);
size++;
}
uint tempBitIndex = bitIndex;
bitIndex = sizeBitIndex;
WriteCustomUnsignedInteger(size, arrayBits);
bitIndex = tempBitIndex;
}
//WRITE BINARY PACKET
public void WriteBinaryPacket(BinaryPacket packet_)
{
uint oldBitIndex = packet_.GetBitIndex();
packet_.ResetBitIndex();
uint packetSize = packet_.Length();//byte size
WriteDynamicUnsignedNbitInteger(packetSize);
for (uint copyBytes = 0; copyBytes < value =" ((buffer[(int)(bitIndex">> (int)(7 - bitIndex % 8)) & 0x1) == 1;
++bitIndex;
}
else
{
packetErrors++;
return true;
}
return value;
}
//Reads an 8 bits unsigned byte from the buffer
public byte ReadUnsignedByte()
{
byte value;
if ((int)((bitIndex + 8) / 8) < datatypesize =" 1;//byte" value =" 0x0;" copybits =" 0;">> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1);
}
bitIndex += dataTypeSize * 8;
}
else
{
packetErrors++;
return 0;
}
return value;
}
//Reads an 8 bits signed byte from the buffer
public sbyte ReadSignedByte()
{
sbyte value;
if ((int)((bitIndex + 8) / 8) < datatypesize =" 1;//byte" value =" 0;">> (int)(7 - bitIndex % 8)) & 0x1) == 1 ? 0xFF : 0x0);
for (uint copyBits = 0; copyBits <>> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1);
}
bitIndex += dataTypeSize * 8;
}
else
{
packetErrors++;
return 0;
}
return value;
}
//Reads a 16 bit unsigned short from the buffer
public ushort ReadUnsignedShort()
{
ushort value;
if ((int)((bitIndex + 16) / 8) < datatypesize =" 2;//byte" value =" 0x0;" copybits =" 0;">> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1);
}
bitIndex += dataTypeSize * 8;
}
else
{
packetErrors++;
return 0;
}
return value;
}
//Reads a 16 bit signed short from the buffer
public short ReadSignedShort()
{
short value;
if ((int)((bitIndex + 16) / 8) < datatypesize =" 2;//byte" value =" (short)(((buffer[(int)(bitIndex">> (int)(7 - bitIndex % 8)) & 0x1) == 1 ? 0xFFFF : 0x0);
for (uint copyBits = 0; copyBits <>> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1);
}
bitIndex += dataTypeSize * 8;
}
else
{
packetErrors++;
return 0;
}
return value;
}
//Reads a 32 bit unsigned integer from the buffer
public uint ReadUnsignedInt()
{
uint value;
if ((int)((bitIndex + 32) / 8) < datatypesize =" 4;//byte" value =" 0x0;" copybits =" 0;">> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1);
}
bitIndex += dataTypeSize * 8;
}
else
{
packetErrors++;
return 0;
}
return value;
}
//Reads a 32 bit signed integer from the buffer
public int ReadSignedInt()
{
int value;
if ((int)((bitIndex + 32) / 8) < datatypesize =" 4;//byte" value =" (int)(((buffer[(int)(bitIndex">> (int)(7 - bitIndex % 8)) & 0x1) == 1 ? 0xFFFFFFFF : 0x0);
for (uint copyBits = 0; copyBits <>> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1;
}
bitIndex += dataTypeSize * 8;
}
else
{
packetErrors++;
return 0;
}
return value;
}
//Reads an n bit custom unsigned integer from the buffer
public uint ReadCustomUnsignedInteger(uint bits)
{
uint value;
if ((int)((bitIndex + bits) / 8) < value =" 0x0;" copybits =" 0;">> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1);
}
bitIndex += bits;
}
else
{
packetErrors++;
return 0;
}
return value;
}
//Reads an n bit custom signed integer from the buffer
public int ReadCustomSignedInteger(uint bits)
{
int value;
if ((int)((bitIndex + bits) / 8) < value =" (int)(((buffer[(int)(bitIndex">> (int)(7 - bitIndex % 8)) & 0x1) == 1 ? 0xFFFFFFFF : 0x0);
for (uint copyBits = 0; copyBits <>> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1;
}
bitIndex += bits;
}
else
{
packetErrors++;
return 0;
}
return value;
}
//Reads a 32 bit floating point number from the buffer
public float ReadFloat()
{
if ((int)((bitIndex + 32) / 8) >= buffer.Count)
{
packetErrors++;
return 0;
}
return BitConverter.ToSingle(BitConverter.GetBytes(ReadUnsignedInt()), 0);
}
//Reads a 64 bit floating point number from the buffer
public double ReadDouble()
{
if ((int)((bitIndex + 32) / 8) >= buffer.Count)
{
packetErrors++;
return 0;
}
byte[] bytes = new byte[8];
byte[] first4bytes = BitConverter.GetBytes(ReadUnsignedInt());
byte[] last4bytes = BitConverter.GetBytes(ReadUnsignedInt());
for (uint copyBytes = 0; copyBytes < copybytes =" 4;" value =" 0;" interval =" (uint)(0x1" intervalcount =" 0;" error =" 0;">= buffer.Count)
{
packetErrors++;
return 0;
}
tempValue = 0;
for (uint copyBits = 0; copyBits <>> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1);
}
bitIndex += arrayBitInterval;
value += tempValue;
intervalCount++;
if (tempValue != interval) break;
}
if (error == 256)
{
packetErrors++;
}
return value;
}
//Reads a dynamic signed integer that ranges in bytes. Has the ability to error out
public int ReadDynamicSignedInteger(uint arrayBitInterval)
{
int sign = ReadBoolean() ? 1 : -1;
int value = (int)ReadDynamicUnsignedInteger(arrayBitInterval);
return value * sign;
}
//Reads the unsigned n bit integer. Has the ability to error out
public uint ReadDynamicUnsignedNbitInteger(uint bits)
{
uint value = 0;
uint copyBits = 0;
uint tempValue;
uint offset = 0;
uint error;
for (error = 0; error <>= buffer.Count)
{
packetErrors++;
return 0;
}
tempValue = (uint)((buffer[(int)((bitIndex + copyBits) / 8)] >> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1);
if ((copyBits + 1) % (bits + 1) == 0 && copyBits != 0)
{
//trace("-bit-" + copyBits + " " + tempValue);
offset++;
//uint nextBit = (uint)((buffer[(int)((bitIndex + copyBits + 1) / 8)] >> (int)(7 - (bitIndex + copyBits + 1) % 8)) & 0x1);
if (tempValue == 0)
{
break;
}
}
else
{
//trace("bit-" + copyBits + " " + tempValue);
value |= (uint)(((buffer[(int)((bitIndex + copyBits) / 8)] >> (int)(7 - (bitIndex + copyBits) % 8)) & 0x1) << (int)(copyBits - offset)); } copyBits++; } if (error == 256) { packetErrors++; } bitIndex += copyBits + 1; return value; } public uint ReadDynamicUnsignedNbitInteger() { return ReadDynamicUnsignedNbitInteger(4); } //Reads the signed n bit integer. Has the ability to error out public int ReadDynamicSignedNbitInteger(uint bits) { int sign = ReadBoolean() ? 1 : -1; int value = (int)ReadDynamicUnsignedNbitInteger(bits); return value * sign; } public int ReadDynamicSignedNbitInteger() { return ReadDynamicSignedNbitInteger(4); } //Reads a custom resolution float public float ReadCustomResolutionFloat(float min, float max, uint bitResolution) { if ((int)((bitIndex + bitResolution) / 8) >= buffer.Count)
{
packetErrors++;
return 0;
}
return ReadCustomUnsignedInteger(bitResolution) / (float)((0x1 << (int)bitResolution) - 1) * (max - min) + min; } //Reads a custom resolution double public double ReadCustomResolutionDouble(double min, double max, uint bitResolution) { if ((int)((bitIndex + bitResolution) / 8) >= buffer.Count)
{
packetErrors++;
return 0;
}
return ReadCustomUnsignedInteger(bitResolution) / (double)((0x1 << (int)bitResolution) - 1) * (max - min) + min; } //Reads a string public string ReadString(uint arrayBitInterval) { string value = string.Empty; uint size = ReadDynamicUnsignedNbitInteger(arrayBitInterval); if ((int)((bitIndex + 7*size) / 8) >= buffer.Count)
{
packetErrors++;
return string.Empty;
}
for (uint stringItr = 0; stringItr <> ReadUnsignedCustomIntegerArray(uint bits, uint arrayBitInterval)
{//arrayBitInterval means that for value <> value = new List
uint size = ReadDynamicUnsignedNbitInteger(arrayBitInterval);
for (uint cycleArray = 0; cycleArray <> ReadSignedCustomIntegerArray(uint bits, uint arrayBitInterval)
{//arrayBitInterval means that for value <> value = new List
uint size = ReadDynamicUnsignedNbitInteger(arrayBitInterval);
for (uint cycleArray = 0; cycleArray <> ReadFloatArray(uint arrayBitInterval)
{
List
uint size = ReadDynamicUnsignedNbitInteger(arrayBitInterval);
for (uint cycleArray = 0; cycleArray <> ReadDoubleArray(uint arrayBitInterval)
{
List
uint size = ReadDynamicUnsignedNbitInteger(arrayBitInterval);
for (uint cycleArray = 0; cycleArray <> ReadCustomResolutionFloatArray(float min, float max, uint bitResolution, uint arrayBitInterval)
{
List
uint size = ReadDynamicUnsignedNbitInteger(arrayBitInterval);
for (uint cycleArray = 0; cycleArray <> ReadCustomResolutionDoubleArray(double min, double max, uint bitResolution, uint arrayBitInterval)
{
List
uint size = ReadDynamicUnsignedNbitInteger(arrayBitInterval);
for (uint cycleArray = 0; cycleArray <> ReadAssociativeArrayStringToUnsignedInteger(uint bits, uint arrayBits)
{
Dictionary
uint size = ReadCustomUnsignedInteger(arrayBits);
for (uint elementItr = 0; elementItr <> ReadAssociativeArrayStringToSignedInteger(uint bits, uint arrayBits)
{
Dictionary
uint size = ReadCustomUnsignedInteger(arrayBits);
for (uint elementItr = 0; elementItr <> ReadAssociativeArrayStringToFloat(uint arrayBits)
{
Dictionary
uint size = ReadCustomUnsignedInteger(arrayBits);
for (uint elementItr = 0; elementItr <> ReadAssociativeArrayStringToDouble(uint arrayBits)
{
Dictionary
uint size = ReadCustomUnsignedInteger(arrayBits);
for (uint elementItr = 0; elementItr <> ReadAssociativeArrayStringToString(uint arrayBits)
{
Dictionary
uint size = ReadCustomUnsignedInteger(arrayBits);
for (uint elementItr = 0; elementItr < packet =" new" packetsize =" ReadDynamicUnsignedNbitInteger();" copybytes =" 0;" bitindex =" 0;" bitindex =" index;"> 0;
}
public string Trace()
{
string s = string.Empty;
for (uint copyBits = 0; copyBits <>> (int)(7 - (copyBits % 8))) & 0x1) == 0 ? "0" : "1");
}
return s;
}
/* Useful operation on an int to display the 32-bit binary */
/*
string s = string.Empty;
for(var i:uint = 0; i <>>(31-i)) & 0x1) == 0 ? "0" : "1");
}
trace(s);
*/
}
}
Không có nhận xét nào:
Đăng nhận xét