コード例 #1
0
        public static long ReadBufferInt64(byte[] buffer, int bufferOffset)
        {
            var longBuffer = new byte[8];

            Buffer.BlockCopy(buffer, bufferOffset, longBuffer, 0, 8);
            return(LittleEndianByteOrder.GetInt64(longBuffer));
        }
コード例 #2
0
        public static double ReadBufferDouble(byte[] buffer, int bufferOffset)
        {
            var doubleBuffer = new byte[8];

            Buffer.BlockCopy(buffer, bufferOffset, doubleBuffer, 0, 8);
            return(LittleEndianByteOrder.GetDouble(doubleBuffer));
        }
コード例 #3
0
        public static int ReadBufferInt32(byte[] buffer, int bufferOffset)
        {
            var intBuffer = new byte[4];

            Buffer.BlockCopy(buffer, bufferOffset, intBuffer, 0, 4);
            return(LittleEndianByteOrder.GetInt32(intBuffer));
        }
コード例 #4
0
 public static void WriteBuffer(int value, byte[] buffer, int bufferOffset)
 {
     Buffer.BlockCopy(LittleEndianByteOrder.GetBytes((int)value), 0, buffer, bufferOffset, 4);
 }