Questions tagged [byte]

A unit of information usually corresponding to 8 bits. This term is also most often used to indicate the smallest addressable unit of storage on a digital system.

A unit of information usually corresponding to 8 bits. This term is also most often used to indicate the smallest addressable unit of storage on a digital system.

These days, the term byte usually refers to a unit of information consisting of 8 . Historically, other sizes have been used as well. If one wants to stress the fixed size, the term octet can be used instead.

7028 questions
2
votes
1 answer

Display byte as unsigned

I'm building an Android app using OpenCV4Android. For manipulating some images I work with (i.e Mat objects), I convert them into a byte[] (using the get method). My problem is that the values of this array appear as unsigned bytes, which makes it…
noamgot
  • 3,618
  • 4
  • 17
  • 37
2
votes
2 answers

Creating an array of digits in base 10, starting from an array of words

So, starting from an array of words, I have to create an array to include the digits of each given word, written in base 10. So if I have s DW 12345, 20778, 4596 the result should be this BYTE array t DB 1, 2, 3, 4, 5, 2, 0, 7, 7, 8, 4, 5, 9,…
Katrin
  • 57
  • 7
2
votes
1 answer

Typing Python sequence to Cython array (and back)

I have successfully used Cython for the first time to significantly speed up packing nibbles from one list of integers (bytes) into another (see Faster bit-level data packing), e.g. packing the two sequential bytes 0x0A and 0x0B into 0xAB. def…
handle
  • 5,063
  • 2
  • 40
  • 69
2
votes
1 answer

How to convert utf8 byte array to a string of given length

Let's say I have an array of bytes: var myArr = new byte[] { 0x61, 0x62, 0xc4, 0x85, 0xc4, 0x87 }; So it has 6 elements while it corresponds to utf8 abąć which has 4 letters. Typically you do Encoding.UTF8.GetString(myArr); to convert it to a…
freakish
  • 48,318
  • 8
  • 114
  • 154
2
votes
3 answers

What does the memory address mean?

Does a hex memory address represent the position in the memory as a whole? e.g. 4 gb ram and there is a memory adress. Does it point to the position(in bytes) that the data starts at? e.g. at 2.1 gb. How do memory address work on hard disk before…
some_id
  • 28,294
  • 58
  • 173
  • 293
2
votes
3 answers

Converting raw-byte values into Java types

I have a problem with converting raw-bytes values into java types. I am receiving bytes by a datagram socket as a bytes array. I know exactly which bytes means what, but I don't know how to convert them appropriately (I mean I know offsets, but…
omnomnom
  • 8,215
  • 4
  • 39
  • 50
2
votes
1 answer

Arrays equals return false for same byte arrays

First I create a signature (byte[] signature). Then I write this signature to the file. I read the signature from this file and give it another variable (byte [] signatureCopy). But when I compare these two variables, it returns false. How can I…
cezaalp
  • 35
  • 1
  • 6
2
votes
1 answer

Save byte array of image in a folder c#

I am converting image name to byte array and i want to save that byte array in a folder here is my code to convert byte array byte[] imgArray = obj.Image.ToByteArray(); where obj.image=image(1).jpg. which is of string type. and I want to save it…
Gaurav_0093
  • 1,054
  • 2
  • 23
  • 45
2
votes
1 answer

How to properly copy an executable byte by byte

I have recently been trying to learn more about copying files via bytes, but I am having trouble. When checking the bytes from the original notepad.exe against notepad2.exe, even though the fread and frwite size is consistent across reading and…
Wilky
  • 35
  • 1
  • 5
2
votes
1 answer

Convert Bytes to Image ASP.NET c# and use it in Image1.Url

I have a WEB-APP that is a Web-Cam App that takes images and stores into a database as bytes, Now with that being said I also don't want to save the images those are taken and save it in any kind of folder right now the only way to show the image…
Simple Code
  • 528
  • 4
  • 19
2
votes
1 answer

Parsing bytes of a bitmap header and saving with file pointers

I'm working on my first project in my first C Programming class and am getting lost with pointers. We are to alter bitmaps in various ways and I'm having a hard time with understanding how I can use file pointers to grab byte data I want to use and…
Pwrcdr87
  • 835
  • 3
  • 11
  • 32
2
votes
2 answers

Convert bytearray from a VARBINARY(16) column into an IP address

I need to extract large amount of data from a HP Vertica database and save it to a file. I am using official ODBC driver from Vertica with pyodbc. This is what I have done so far: cnxn =…
Mikhail Venkov
  • 298
  • 1
  • 10
2
votes
2 answers

Convert a bytearray in hex to an IP address python

I have an ip address in this format b'\xd4\xfbuW' I know that this is an actual IP address, but I don't know how I can print it as a normal (like 192.168.1.1) address and also store it in my memory as a string. How can I decode this hex bytearray?
Tasos
  • 1,209
  • 2
  • 15
  • 36
2
votes
3 answers

Read from array two bytes at a time?

I declare an array uint8_t data_buffer[64]; I write into it, and then I need to iterate over it looking at the data it stores. The data is written in groups of two. Right now I am doing something messy like this for(int i = 1; i < BUFFER_LEN + 1;…
Indigo
  • 682
  • 6
  • 18
2
votes
1 answer

Hex to Bytes, ruby and java

I have the following code to convert hex string to bytes in Java: String s = "longhex"; int len = s.length(); byte[] data = new byte[(len / 2)]; for (int i = 0; i < len; i += 2) { data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) +…
Ilya Cherevkov
  • 1,673
  • 2
  • 17
  • 43