enow.com Web Search

Search results

  1. Results from the WOW.Com Content Network
  2. .net - What is a byte[] array? - Stack Overflow

    stackoverflow.com/questions/3089004

    In C# (and C, C++, Java, and many other languages), a byte array is simply a contiguous chunk of memory. Thus a byte[n] array is a block of n bytes. Byte arrays typically have no type other than "byte", which is simply an 8-bit data item. Byte arrays are generally used for low-level I/O, such as read/write buffers for files and networks, as ...

  3. Is there 'byte' data type in C++? - Stack Overflow

    stackoverflow.com/questions/20024690

    39. No there is no byte data type in C++. However you could always include the bitset header from the standard library and create a typedef for byte: typedef bitset<8> BYTE; NB: Given that WinDef.h defines BYTE for windows code, you may want to use something other than BYTE if your intending to target Windows.

  4. c# - Literal suffix for byte in .NET? - Stack Overflow

    stackoverflow.com/questions/5378036

    The only literal suffixes in C# are for integer and real numbers as follows: u = uint. l = long. ul = ulong. f = float. m = decimal. d = double. If you want to use var, you can always cast the byte as in var y = (byte) 5. Although not really related, in C#7, a new binary prefix was introduced 0b, which states the number is in binary format.

  5. c# - byte[] to hex string - Stack Overflow

    stackoverflow.com/questions/623104

    How do I convert a byte[] to a string? Every time I attempt it, I get System.Byte[] instead of the value. Also, how do I get the value in Hex instead of a decimal?

  6. How can I convert a byte array to hexadecimal in Java?

    stackoverflow.com/questions/2817752

    Byte byteValue = intValue.byteValue(); // this will convert the rightmost byte of the intValue to byte, because Byte is an 8 bit object and Integer is at least 16 bit, and it will give you a signed number in this case -107

  7. arrays - byte[] to file in Java - Stack Overflow

    stackoverflow.com/questions/4350084

    20. From Java 7 onward you can use the try-with-resources statement to avoid leaking resources and make your code easier to read. More on that here. To write your byteArray to a file you would do: try (FileOutputStream fos = new FileOutputStream("fullPathToFile")) {. fos.write(byteArray);

  8. c - How to print 1 byte with printf? - Stack Overflow

    stackoverflow.com/questions/41638330

    Assumption:You want to print the value of a variable of 1 byte width, i.e., char. In case you have a char variable say, char x = 0; and want to print the value, use %hhx format specifier with printf(). Something like. printf("%hhx", x); Otherwise, due to default argument promotion, a statement like. printf("%x", x); would also be correct, as ...

  9. Converting string to byte array in C# - Stack Overflow

    stackoverflow.com/questions/16072709

    byte[] bytes = Encoding.ASCII.GetBytes(someString); You will need to turn it back into a string like this: string someString = Encoding.ASCII.GetString(bytes); If you can find in the code you inherited, the encoding used to create the byte array then you should be set.

  10. c# - Byte[] to ASCII - Stack Overflow

    stackoverflow.com/questions/6554869

    Use: string str = System.Text.Encoding.ASCII.GetString(buf); It worked! It also works on any subset of the input buffer - using the variation with two extra parameters: ASCIIEncoding.GetString(byte[] bytes, int byteIndex, int byteCount) (or without the third parameter for until the end of the buffer).

  11. Javascript variable type (byte) - Stack Overflow

    stackoverflow.com/questions/1913194

    Now available on Stack Overflow for Teams! AI features where you work: search, IDE, and chat. Learn more Explore Teams