﻿static class System.BitConverter

method byte[] GetBytes(bool)
	java java.nio.ByteBuffer.allocate(1).put((byte)({0} ? 1 : 0)).array()
	python int({0}).to_bytes(1, byteorder="little")
	js Utils.objectToBytes({0}, 'bool')
	php Utils::ObjectToBytes({0}, 'bool')

method byte[] GetBytes(byte)
	java java.nio.ByteBuffer.allocate(1).put({0}).array()
	python ({0}).to_bytes(1, byteorder="little")
	js Utils.objectToBytes({0}, 'byte')
	php Utils::ObjectToBytes({0}, 'byte')

method byte[] GetBytes(char)
	java java.nio.ByteBuffer.allocate(2).order(java.nio.ByteOrder.LITTLE_ENDIAN).putChar({0}).array()
	python ord({0}).to_bytes(2, byteorder="little")
	js Utils.objectToBytes({0}, 'char')
	php Utils::ObjectToBytes({0}, 'char')

method byte[] GetBytes(short)
	java java.nio.ByteBuffer.allocate(2).order(java.nio.ByteOrder.LITTLE_ENDIAN).putShort({0}).array()
	python ({0}).to_bytes(2, byteorder="little")
	js Utils.objectToBytes({0}, 'short')
	php Utils::ObjectToBytes({0}, 'short')

method byte[] GetBytes(ushort)
	java java.nio.ByteBuffer.allocate(2).order(java.nio.ByteOrder.LITTLE_ENDIAN).putShort({0}).array()
	python ({0}).to_bytes(2, byteorder="little")
	js Utils.objectToBytes({0}, 'ushort')
	php Utils::ObjectToBytes({0}, 'ushort')

method byte[] GetBytes(int)
	java java.nio.ByteBuffer.allocate(4).order(java.nio.ByteOrder.LITTLE_ENDIAN).putInt({0}).array()
	python ({0}).to_bytes(4, byteorder="little")
	js Utils.objectToBytes({0}, 'int')
	php Utils::ObjectToBytes({0}, 'int')

method byte[] GetBytes(uint)
	java java.nio.ByteBuffer.allocate(4).order(java.nio.ByteOrder.LITTLE_ENDIAN).putInt({0}).array()
	python ({0}).to_bytes(4, byteorder="little")
	js Utils.objectToBytes({0}, 'uint')
	php Utils::ObjectToBytes({0}, 'uint')

method byte[] GetBytes(long)
	java java.nio.ByteBuffer.allocate(8).order(java.nio.ByteOrder.LITTLE_ENDIAN).putLong({0}).array()
	python ({0}).to_bytes(8, byteorder="little")
	php Utils::ObjectToBytes({0}, 'long')
	js Utils.objectToBytes({0}, 'long')

method byte[] GetBytes(ulong)
	java java.nio.ByteBuffer.allocate(8).order(java.nio.ByteOrder.LITTLE_ENDIAN).putLong({0}).array()
	python ({0}).to_bytes(8, byteorder="little")
	php Utils::ObjectToBytes({0}, 'ulong')
	js Utils.objectToBytes({0}, 'ulong')

method byte[] GetBytes(float)
	java java.nio.ByteBuffer.allocate(4).order(java.nio.ByteOrder.LITTLE_ENDIAN).putFloat({0}).array()
	python bytearray(struct.pack("f", {0}))  import struct
	js Utils.objectToBytes({0}, 'float')
	php Utils::ObjectToBytes({0}, 'float')

method byte[] GetBytes(double)
	java java.nio.ByteBuffer.allocate(8).order(java.nio.ByteOrder.LITTLE_ENDIAN).putDouble({0}).array()
	python bytearray(struct.pack("d", {0}))  import struct
	js Utils.objectToBytes({0}, 'double')
	php Utils::ObjectToBytes({0}, 'double')

method bool ToBoolean(byte[], int)
	java ({0})[{1}] == (byte)1
	python ({0})[{1}] == 1
	js ({0})[{1}] == 1
	php ({0})[{1}] == 1

method bool ToByte(byte[], int)
	java ({0})[{1}]
	python int.from_bytes({0}[{1}:{1}+1], byteorder="little")
	js ({0})[{1}]
	php ({0})[{1}]

method char ToChar(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 2).order(java.nio.ByteOrder.LITTLE_ENDIAN).getChar()
	python chr(int.from_bytes({0}[{1}:{1}+2], byteorder="little"))
	js Utils.bytesToObject({0}, {1}, 'char', 2)
	php Utils::BytesToObject({0}, {1}, 'char', 2)

method short ToInt16(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 2).order(java.nio.ByteOrder.LITTLE_ENDIAN).getShort()
	python int.from_bytes({0}[{1}:{1}+2], byteorder="little")
	js Utils.bytesToObject({0}, {1}, 'short', 2)
	php Utils::BytesToObject({0}, {1}, 'short', 2)

method ushort ToUInt16(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 2).order(java.nio.ByteOrder.LITTLE_ENDIAN).getShort()
	python int.from_bytes({0}[{1}:{1}+2], byteorder="little")
	js Utils.bytesToObject({0}, {1}, 'ushort', 2)
	php Utils::BytesToObject({0}, {1}, 'ushort', 2)

method int ToInt32(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 4).order(java.nio.ByteOrder.LITTLE_ENDIAN).getInt()
	python int.from_bytes({0}[{1}:{1}+4], byteorder="little")
	js Utils.bytesToObject({0}, {1}, 'int', 4)
	php Utils::BytesToObject({0}, {1}, 'int', 4)

method uint ToUInt32(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 4).order(java.nio.ByteOrder.LITTLE_ENDIAN).getInt()
	python int.from_bytes({0}[{1}:{1}+4], byteorder="little")
	js Utils.bytesToObject({0}, {1}, 'uint', 4)
	php Utils::BytesToObject({0}, {1}, 'uint', 4)

method long ToInt64(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 8).order(java.nio.ByteOrder.LITTLE_ENDIAN).getLong()
	python int.from_bytes({0}[{1}:{1}+8], byteorder="little")
	php Utils::BytesToObject({0}, {1}, 'long', 8)

method ulong ToUInt64(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 8).order(java.nio.ByteOrder.LITTLE_ENDIAN).getLong()
	python int.from_bytes({0}[{1}:{1}+8], byteorder="little")
	php Utils::BytesToObject({0}, {1}, 'ulong', 8)

method float ToSingle(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 4).order(java.nio.ByteOrder.LITTLE_ENDIAN).getFloat()
	python struct.unpack('f', {0}[{1}:{1}+4])[0]  import struct
	js Utils.bytesToObject({0}, {1}, 'float', 4)
	php Utils::BytesToObject({0}, {1}, 'float', 4)

method float ToDouble(byte[], int)
	java java.nio.ByteBuffer.wrap({0}, {1}, 8).order(java.nio.ByteOrder.LITTLE_ENDIAN).getDouble()
	python struct.unpack('d', {0}[{1}:{1}+8])[0]  import struct
	js Utils.bytesToObject({0}, {1}, 'double', 8)
	php Utils::BytesToObject({0}, {1}, 'double', 8)

