Category "byte"

How to optimise reading multiple files containing bytes into a NumPy array

I currently have ~1000 files containing bytes. Each file contains a few thousand messages, each message has identical data types. I've tried several ways of rea

How to modify byte strings?

Let's say I have the following ELF file in python: >>> data=open('file','rb').read() >>> data b'\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x0

How to convert a two-dimensional byte array into a single byte (Arduino)?

I have this array: bool data[] = {{1,1,1,1},{0,0,0,0}}; And I need to convert it into bool data type like this: byte data = 11110000; Any ideas?

Bit shifting a half-float into a float

I have no choice but to read in 2 bytes that make up a half-float. I would like to work with this in the form of a 4 byte float. Ive done some research and the

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

Logging error in Python 3.x : TypeError: a bytes-like object is required, not 'str'

I am on Python 3.6.5. While using logging I am getting the following error - "TypeError: a bytes-like object is required, not 'str'" It worked fine in Python

How do I add bits to a MemoryStream

So I've been trying to add bits of a value to a MemoryStream but the issue is I have no idea how. I've seen that it's used for performance when it comes to netw

Printing a pdf file on a thermal printer

I getting issue, printing through bluetooth on thermal printer from pdf file become text view. Print Pdf file via Bluetooth Printer Android I was tried these

How to convert hex string to byte array in Java

I want to convert an hex string to byte array, I know these type of questions are already asked, I have tried their solution, But these solutions are not workin

How do I 'declare' an empty bytes variable?

How do I initialize ('declare') an empty bytes variable in Python 3? I am trying to receive chunks of bytes, and later change that to a utf-8 string. However, I

Comparison of byte literals in Python

The following question arose because I was trying to use bytes strings as dictionary keys and bytes values that I understood to be equal weren't being treated a