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.

7742 questions
2
votes
2 answers

How to convert Uint8List to decimal number in Dart?

I have an Uint8List data list, for example: Uint8List uintList = Uint8List.fromList([10, 1]); How can I convert these numbers to a decimal number? int decimalValue = ??? // in this case 265
CookieMonster
  • 566
  • 2
  • 6
  • 19
2
votes
1 answer

in java i am trying to use & with a filter to get each byte of an integer it works for the last 3 bytes but the first throws a number format exception

hi thanks in advance for your help, i am trying to write a program that will allow you to reorder the bytes in a integer i plan on separating the bytes with a filter like so int number = 3; int filter =…
Mark
  • 25
  • 3
2
votes
1 answer

Implementation of memset to set a whole word instead of byte by byte in C

So I'm trying to implement my personal MemSet that will do the same as memset but also: Copy word size chunks when possible, instead of byte by byte. Guarantee dest's alignment Test for all alignment possibilities So this is my code: void…
NoobCoder
  • 513
  • 3
  • 18
2
votes
3 answers

Fast concatenation of bytes() in python3

I have an array of byte-strings in python3 (it's an audio chunks). I want to make one big byte-string from it. Simple implementation is kind of slow. How to do it better? chunks = [] while not audio.ends(): chunks.append(…
al.zatv
  • 173
  • 1
  • 13
2
votes
0 answers

Negative values in byte[] in Java, but not in Python

Why does Java allow byte arrays to contain negative values such as byte[] array = new byte[-90, -23, 118, 23, 3, 0, 0, 23, 39] but Python does not?
user12601909
2
votes
1 answer

Transmit audio to Doorbird device

I'm trying to create an Android app that connects to the Doorbird device, I know the company's official app, but, I need more features that are tailored to my needs. For someone that doesn't know what is Doorbird device, Doorbird is a smart…
Yonibagi
  • 147
  • 10
2
votes
0 answers

How to XOR two arrays of bytes in Python

I would like to perform an XOR between two arrays of bytes declared as: a = bytes([0x01, 0x02, 0x04, 0x08]) b = bytes([0x55, 0x55, 0x55, 0x55]) I already tried a ^ b, but I've got the following error: unsupported operand type(s) for ^: 'bytes' and…
Geektonik
  • 31
  • 3
2
votes
1 answer

Flutter Image.memory() ERROR Invalid image data

I'm trying to dislpay image.memory but I'm getting an error as the following photo showing. The bytes of image are the following. UPDATE -1- Below you see my code UPDATE -2- The result if snpashot.data is null or not UPDATE -3- The changes that…
2
votes
1 answer

Upload files via web api, the files are sent as byte[]

I'm trying to upload files via web api, the files are sent as byte[]. I manage to upload only one file per request, but if I select multiple files it only upload one file. This is the client side code: var content = new…
דניאל
  • 183
  • 9
2
votes
1 answer

Chronicle Queue Read/write from queue using zero allocation

I am a new user of chronicle queue and I wanna use a zero allocation strategy to read and write the objects from chronicle queue. I want to use a queue and a marshable implementation of bytes like a pojo class is the that some correct strategy? I…
2
votes
2 answers

Confused with byte convertion to int

How a byte value b when uses as int in the Integer.toBinaryString() have a binary value much more than byte type can contain? I thought s1 should be in range [0, 11111111]. And how this bitwise operator (b & 0B11111111) changes the situation? It…
Denys_newbie
  • 1,140
  • 5
  • 15
2
votes
1 answer

How can I parse a binary file that seems to use a mix of Unicode Code Points and Hex values for strings?

I have a binary file with text in it. I need to grab the hex bytes of the string, and convert them to readable text. I'm using Python 3. The encoding appears to be UTF-8, but I've been having some trouble decoding some specific strings. You see,…
tralph3
  • 452
  • 4
  • 13
2
votes
1 answer

How can I display image from byte data in Flutter

I have two sides for my projects. One is a camera, with which we use OpenCV, to capture frames, in 8 bit 3 channel (R,G,B), format and write it to socket to be streamed. Image is 640 x 480 resolution, so 640x480x3 bytes are written to the socket. On…
dramaticlook
  • 653
  • 1
  • 12
  • 39
2
votes
1 answer

Python merges 4 digit hex to 3 digit hex

I'm trying to send some bytes from Python. I'm using struct.pack to get the corresponding sending bytes. For example: >>> struct.pack('BBBBBh', 200, 0, 56, 6, 0, 6) '\xc8\x008\x06\x00\x00\x06\x00' If you take a close look, you can see that the…
2
votes
1 answer

Sign(+/-) error in byte in Java byte setting operations

I am declearing in Java public byte[] orbits = new byte[38]; Now if I am doing orbits[24] = (byte)0xFF; orbits[24] should get populated by 11111111 i.e FF(in hexadecimal) but instead its getting populated with -1. This operation in C++ working…
JavaBits
  • 2,005
  • 11
  • 36
  • 40
1 2 3
99
100