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
2
votes
2 answers

Swift - writing a byte stream to file

I have a string of several hundred bytes and some Int32 values. I want to write these to a file, verbatim. I have tried many suggested solutions and none have worked for me. I get extraneous brackets or spaces or commas in the file. Can anyone…
Simon Youens
  • 177
  • 1
  • 13
2
votes
1 answer

Problems with decoding bytes into string or ASCII in python 3

I'm having a problem decoding received bytes with python 3. I'm controlling an arduino via a serial connection and read it with the following code: import serial arduino = serial.Serial('/dev/ttyACM0', baudrate=9600,…
kire
  • 95
  • 2
  • 12
2
votes
1 answer

Why does PrintStream inherit from byte streams?

As far as I know java.io ist divided into byte streams and character streams. Byte streams for reading and writing bytes and character streams for reading and writing characters. PrintStream has following inheritance hierarchy: Object <-…
gstackoverflow
  • 36,709
  • 117
  • 359
  • 710
2
votes
2 answers

Stream object that handles numbers

This may be a very basic question but while digging through STL reference I can't find anything suitable. As an example std::ostringstream oss; oss << "One hundred and one: " << 101; would result in One hundred and one: 101 stored in oss, means the…
Elmi
  • 5,899
  • 15
  • 72
  • 143
1
vote
1 answer

How can I get an file-like object from Selenium without download a file to a local path?

I'm working on a parser platform. I need to download files, save them directly to the FTP server. For this I have to get file-like object. I don't want to save junk temporary files. I need to use selenium specifically For example: I need to download…
1
vote
1 answer

How to know when to use byteStream for reading data and when to use charStream for reading data from a file?

I am trying to understand if I need to read data from different types of files (.properties file, json file, text file etc) or from console, which java class should I use and why exactly. Some classes are reading data in the form of bytes (8 bits)…
1
vote
0 answers

Read binary data of video files & Open it from Google Drive

I tried to read a video store on Google Drive by get the file data content following the code block below, i don't want to download the file to local, just read & load directly from GD., ... def print_file_content(service, file_id):   """Print a…
1
vote
1 answer

Transform byte array to string while supporting different encodings

Let's say I have read the binary content of a text file into a std::vector and I want to transform these bytes into a string representation. As long as the bytes are encoded using a single-byte encoding (ASCII for example), a…
Erik So
  • 57
  • 8
1
vote
0 answers

Android - How to get Real time (While recording) video recording data from camera in android?

I wanted to transfer live video (android device camera) to destination (may be another android device / video supported device). So how do I get the camera video data (may be byte[]) so that I can send the data to receiver. for e.g., Real Time means…
1
vote
2 answers

Checking for equality if either input can be `str` or `bytes`

I am trying to write a function that checks if two strings (with ASCII-only content) or bytes are equal. Right now I have: import typing as typ def is_equal_str_bytes( a: typ.Union[str, bytes], b: typ.Union[str, bytes], ) -> bool: if…
norok2
  • 25,683
  • 4
  • 73
  • 99
1
vote
2 answers

How to read a selected file to Bytes or into a Stream

I'm trying to send a file selected using react-native-document-picker over WebRTC, but I can't seem to get to reading it to bytes. In a browser I would use a FileReader to read from
Program-Me-Rev
  • 6,184
  • 18
  • 58
  • 142
1
vote
0 answers

Piping Python struct/raw bytes in bash, and "TypeError: a bytes-like object is required"

There are plenty of questions with this Python error; I've seen: Python struct.unpack errors with TypeError: a bytes-like object is required, not 'str' struct unpack (Type Error: a byte like object is required, not 'str"), Unpack a List? Error…
sdbbs
  • 4,270
  • 5
  • 32
  • 87
1
vote
1 answer

Byte communication between RPI4 and Wavesharemodule via uart

I have bought the wavesharebarcodereader module (https://www.waveshare.com/wiki/Barcode_Scanner_Module) and managed that it decodes codes and sends the data to the rpi. Now i try to use it in command Mode where i can trigger the scanning by sending…
1
vote
1 answer

Why does PyAudio cut off audio from NumPy array?

I accidentally forgot to convert some NumPy arrays to bytes objects when using PyAudio, but to my surprise it still played audio, even if it sounded a bit off. I wrote a little test script (see below) for playing 1 second of a 440Hz tone, and it…
BatWannaBe
  • 4,330
  • 1
  • 14
  • 23
1
vote
1 answer

.NET The input stream is not a valid binary format tcp

Please tell where i can have problem in my code? I serialize the data into a list of objects, then send it to the tcp server for further manipulations This is how serialization works: var objList = new List { path, …
Taifunov
  • 533
  • 1
  • 4
  • 9
1 2
3
11 12