bitconverter
What are the use-cases for IsLittleEndian in BitConverter class?
I was so happy when I discovered IsLittleEndian field in BitConverter. I thought of course it should be the开发者_高级运维re and I should be able to specify whatever endian I like. Well, my happiness[详细]
2023-03-14 12:25 分类:问答C# - Read a double value
Suppose there is only one single double value written into a file in binary format. How can I read that value using C# or Java?[详细]
2023-03-14 12:07 分类:问答c++ Convert string to bytes to send over tcp
I\'m trying to send a 28 character string to a remote ip address and port. I\'ve done this successfully in vb.net using the following code snippets:[详细]
2023-03-13 03:40 分类:问答BitConverter VS ToString for Hex
Just wondering if someone could explain why the two following lines of code return \"different\" results? What causes the reversed values? Is this something to do with endianness?[详细]
2023-03-08 09:48 分类:问答BitConvert.IsLittleEndianon on different endian architectures
The documentation of Bit开发者_如何学PythonConverter.IsLittleEndian says: Indicates the byte order (\"endianness\") in which data is stored in this computer architecture.[详细]
2023-03-05 11:06 分类:问答Converting raw byte data to float[]
I have this code for converting a byte[] to float[]. public float[] ConvertByteToFloat(byte[] array) { float[] floatArr = new float[array.Length / sizeof(float)];[详细]
2023-02-11 08:18 分类:问答Fast casting in C# using BitConverter, can it be any faster?
In our application, we have a very large byte-array and we have to convert these bytes into different types. Currently, we use BitConverter.ToXXXX() for this purpose. Our heavy hitters are, ToInt16 an[详细]
2023-02-08 20:33 分类:问答Converting Int32 to 24-bit signed integer
I have a need to convert an Int32 value to a 3-byte (24-bit) integer. Endianness remains the same (little), but I cannot figure out how to move the sign appropriately. The values are alr开发者_如何学C[详细]
2023-02-08 18:29 分类:问答Convert pointer to loop option in C#
How would I convert this into 开发者_JAVA百科a loop and not to use the pointer. byte[] InputBuffer = new byte[8];[详细]
2023-02-08 10:35 分类:问答BitConverter.ToInt16 Adds 0xFFFF to Number? (C#)
I\'ve got a problem here that\'s probably something that I\'m just overlooking, but I can\'t understand why it\'s happening...[详细]
2023-01-24 03:17 分类:问答