Questions tagged [bytestream]

A bytestream is a series of bytes.

Formally, a byte stream is a certain abstraction, a communication channel down which one entity can send a sequence of bytes to the entity on the other end. Such channel is often bidirectional, but sometimes unidirectional. In almost all instances, the channel has the property that it is reliable; i.e. exactly the same bytes emerge, in exactly the same order, at the other end.

Less formally, one can think of it as a conduit between the two entities; one entity can insert bytes into the conduit, and the other entity then receives them. This conduit can be ephemeral or persistent.

See more:

173 questions
0
votes
1 answer

io.BytesIO is very slow. Alternatives? Optimizations?

I am running a Python v3.5 script on a Raspberry Pi with a camera. The program involves recording video from the picamera and taking a sample frame from the video stream to perform operations on. Sometimes, it takes a very long time (20+ s) to…
WesH
  • 460
  • 5
  • 15
0
votes
0 answers

Encoding Pillow Image to b64 causing invalid base64 encoded string

Im working with images using Pillow. I'm trying to capture the results in a bytes string directly so that I can save to a database without first saving to the local filesystem. The code works for many images but fails on one of them. I've tried…
Neil
  • 3,020
  • 4
  • 25
  • 48
0
votes
1 answer

How to convert list of bytes generated from PNG to RGB values of each pixel?

I am trying to figure out how to load a PNG image and create a matrix containing the RGB values of each pixel. I am currently using the following method to load the file and get the various RGB values: def to_pixels File.open(@file, 'r') do…
michjo
  • 407
  • 2
  • 17
0
votes
1 answer

Akka source sends incomplete message

I'm sending bytes as array of bytestrings through akka Source and Tcp, length of full array which includes: begin ++ len ++ gzip ++ sign ++ term is 997, but only 710 bytes reach the server. The code is here: import akka.actor.ActorSystem import…
0
votes
0 answers

Appending one .flv video file with another

I'm trying to combine two .flv video files together into one, but even though the output file's size is exactly the sum of the two videos I am trying to combine -1, when I try to play the new video file it plays the first file. I'm sure it has to do…
0
votes
0 answers

Raw wav bytes to uint array or some other format

I need to read a file as bytes to use the webrtcvad library. I have done this like in the example from his github: def read_wave(path): """Reads a .wav file. Takes the path, and returns (PCM audio data, sample rate). """ with…
Isaac
  • 1,436
  • 2
  • 15
  • 29
0
votes
0 answers

Need to Slice a byte class into separate parts to then resend in python

I am looking to try and break this incoming byte string into the small number of 10 byte parts as I can for resending. I have looked everywhere but I believe that the answer is to simple and I have simply overlooked it. Here is an example of what I…
0
votes
1 answer

Read N number of bytes from stdin of python and output to a temp file for further processing

I would like to read a fixed number of bytes from stdin of a python script and output it to one temporary file batch by batch for further processing. Therefore, when the first N number of bytes are passed to the temp file, I want it to execute the…
Vishnu
  • 499
  • 1
  • 5
  • 23
0
votes
1 answer

Converting list of dictionaries into bytes_stream

I am trying to convert the type of the data fetched from the database into the binary type. The data fetched from the database is in the form of a list. Below is the sample code: def WriteData(data): jsonData = json.dumps(data) binaryData =…
Dyuti Jain
  • 11
  • 1
  • 2
0
votes
1 answer

Why do byte arrays turn to gibberish when serialized?

What happens to the original structure of the data that was passed through a call like this: MyImg bytes = new MyImg { Id = 1, Img = new byte[] { 1, 0, 5 }, Text = "hiiiiiii" …
Mohamoud Mohamed
  • 515
  • 7
  • 16
0
votes
2 answers

A basic Golang stream(channel) deadlock

I am trying to work with go streams and I have a few "stupid" question. I have done a primitive stream example with the byte limit range and here is the working code and here are my questions. 1 - why this code shows 1 and 2 at the new line? Why…
Velidan
  • 5,526
  • 10
  • 48
  • 86
0
votes
2 answers

Python : Interruption between sending chunks via uart

I'm sending some data via uart. I take single file and split it into 5120byte parts(chunks). Between sending this chunks there is interruption (probably based on baudrate value) I need to catch this interruption and switch from sending data to…
KyluAce
  • 933
  • 1
  • 8
  • 25
0
votes
0 answers

NSData to NSArray conversion as Strings without String interpretation

I have an NSData object whose contents are raw bytes looking something like this: 1e050014 c8d7b452 28f98c72 e95748b9 2801086b e85b07b9 2c010054 01000014 88c9b452 68878a72 e95748b9 2801086b e85707b9 20030154 10050014 a84bb552 c8299a72 e95748b9…
j.doe
  • 3
  • 5
0
votes
1 answer

Convert a ByteStream to CSV Format

{ "report":…
0
votes
1 answer

How to set up ProgressBar for inputStream?

I'm trying to setup ProgressDialog to show to the user the progress of an InputStream of bytes. I'm able to show this in the console of the Android Studio by way of this below : Log.d(TAG, "Progress, transferred " + Integer.toString(100 * …
Jonas
  • 474
  • 3
  • 17