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
1
vote
1 answer

Python Ctype to create a structure/pointer breaks with char array

I have a google protobuf serialized string(its a serialized string), it contains text, mac address and ip address in bytes. I am trying to make a c structure with this string using python c type. If my mac or ip contains consecutive zeroes, it will…
Thomas John
  • 2,138
  • 2
  • 22
  • 38
1
vote
1 answer

What's the use of magic method __wakeup as I can reconstruct any resources that the object may have using unserizlize() only?

According to the documentation : unserialize() checks for the presence of a function with the magic name __wakeup(). If present, this function can reconstruct any resources that the object may have. The intended use of __wakeup() is to…
user9059272
1
vote
0 answers

Python 3 to_bytes function shows wrong result

I'm trying use the to_bytes function. In most cases it works good for me but not always. For example: byteData = (212168254).to_bytes(4,'big') print (byteData) print should give me b'\x0c\xa5\x6e\x3e' but it gives me b'\x0c\xa5n>'. Why is that?
user8207105
1
vote
1 answer

How convert NSInputStream to UIImage

I have an NSInputStream that I'm sending to server and while upload is going on, I want to display image that's uploading. Method is located in singleton and it's receiving that NSInputStream. Is there a way to read that stream and convert it to…
Srdjan
  • 106
  • 10
1
vote
1 answer

Is it possible to read a certain amount of a file each time?

In C# is it possible to read only a certain amount of bytes of data from a file every time read is executed? It would accomplish the same thing as the python line of code below data=file.read(1024) Where 1024 is the amount of bytes it reads. data…
Tom
  • 71
  • 1
  • 2
  • 11
1
vote
1 answer

OCaml Bytes to Bigarray

I have a C program that has in memory an array of double or an array of int. The C program sends the corresponding binary data using ZeroMQ to an OCaml program. The OCaml program receives some bytes, and now I want to transform these bytes into an…
Anthony Scemama
  • 1,563
  • 12
  • 19
1
vote
2 answers

Writing more data to file than reading?

I am currently experimenting with how Python 3 handles bytes when reading, and writing data and I have come across a particularly troubling problem that I can't seem to find the source of. I am basically reading bytes out of a JPEG file, converting…
1
vote
2 answers

c++ read unknow amount of data from socket

I wrote a simple tcp/ip connection client-server in c++. This is the part of the server that handles the connection int sockfd, newsockfd; socklen_t clilen; struct sockaddr_in serv_addr, cli_addr; int n = 0; sockfd =…
J.kol
  • 43
  • 1
  • 6
1
vote
1 answer

Python: how to decode bytestream string on the server side

I send my JSON using urllib.request on Python 3. data = {"a": "1"} req = urllib.request.Request('https://example.com', data=json.dumps(data).encode('utf8'), headers={'Content-Type': 'application/json'}) urllib.request.urlopen(req) The problem is…
yuval
  • 2,848
  • 4
  • 31
  • 51
1
vote
1 answer

Parse Bytestream in C (embedded programming)

So I have a communication system between two microcontrollers and I'm sending data between them, i.e. sensor data from one µC to the other one, and commands back. The sensor data is taken from a struct and put into a frame, which looks like this…
Matty
  • 63
  • 1
  • 9
1
vote
1 answer

Converting byte array to pdf throws error when opening the dcoument

I am developing a WCF service that downloads a pdf file from a internet portal converts it into byte array and sends it to the client. On client side i am converting this byte array to pdf by using WriteAllBytes method. But while opening the pdf…
TheCoder
  • 181
  • 4
  • 12
1
vote
0 answers

How to Save as a PDF file from Byte stream in iOS

When i used Sharepoint(getItem) Web Service for getting PDF file i got the response as Byte Stream, I am trying to convert these Byte Stream as PDF file using below code, NSMutableData *saveData = [NSMutableData data]; NSData…
Siyad
  • 19
  • 4
1
vote
0 answers

Execute exe stored in a byte array in java?

I am trying to write a java program which will receive an exe as byte stream and store it in a byte array and this byte array should be executed directly. The byte array cannot be written to a file because the java program is being run on a system…
user3693762
1
vote
1 answer

How to find any of I/B/P frames in h264?

I need to find any (I/B/P) new frame in h264 byte stream. I heard about NAL header, but I have such a strange stream: 00 00 00 01 09 F0 00 00 00 01 67 64 00 1E AC B2 01 40 5F F2 E0 22 00 00 07 D2 00 01 D4 C0 1E 2C 5C 90 00 00 00 01 68 EB C3 CB…
user3652819
  • 125
  • 3
  • 11
1
vote
0 answers

data not arriving intact after bluetooth transfer

I'm using the Google sample app code for bluetooth communication http://developer.android.com/guide/topics/connectivity/bluetooth.html And it works perfectly well for small chunks of data. However, I'm trying to transmit an Bitmap encoded as a…
Yevgeny Simkin
  • 27,946
  • 39
  • 137
  • 236