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

in java: How can i identify file extension/file type from file in binary data (BYTEA) with mime_type 'application/octet-stream' and save to disk?

From a database migration, we have a data-dump in a postgreSQL database. The task is to write a script in java or groovy in order to read out the files in the correct format and save them to the server. For some files, the mime_type is specified…
1
vote
1 answer

ObjectInputStream fails initialization with ByteArrayInputStream

So I am writing a discord bot using Java (JDA Library) and I'm making a database system... I start of with just writing YML and JSON to files and then I start serializing objects using ObjectInputStream and the Output version. Then I got the idea to…
user14310923
1
vote
1 answer

Internal working of byte streams. Difference between write(65) and write('A')?

Both of these lines will write me letter A in a file. Can someone tell me how are they different in internal working? FileOutputStream fileOutputStream = new…
Stefan
  • 969
  • 6
  • 9
1
vote
1 answer

Read values from unsigned char bytestream in C++

my task is to read metadata values from a unsigned char array, which contains the bytes of a binary .shp file (Shapefile) unsigned char* bytes; The header of the file which is stored in the array and the order of the information stored in it looks…
Samuel Dressel
  • 1,181
  • 2
  • 13
  • 27
1
vote
1 answer

What is the opposite of fromtimestamp()?

I'm trying to figure out how to import a binary file into python, but it's a lot of guesswork and trial and error. What I'd like to do in this case to is find where a specific date occurs in the bytestream, i.e: import re import datetime import…
Sal
  • 37
  • 1
  • 6
1
vote
1 answer

How ByteStream works?

How raw data is divided into bytes. As present audio contains 32bit(2^32 tones) it ranges from 2^0 - 2^32. ex -> 6710497.. (Considering decimal) how is it divided to 67 104 97 Does FileInputStream has a method to check like if(671>256){send 67 ,…
Sathvik
  • 565
  • 1
  • 7
  • 17
1
vote
1 answer

Python: AttributeError: 'generator' object has no attribute 'read'

I try to use this class Archive. However, I got the "AttributeError: 'generator' object has no attribute 'read' " from " return Archive('r',strm.read())". class Archive(object): def __init__(self, mode, data=None): self.file =…
LnC21
  • 11
  • 4
1
vote
1 answer

Read file and convert to bytes in nodejs

I have the following code block in Java which I am trying to replicate in nodejs Java ---- Blob attachmentFile = (Blob) attachments.get(i).get("attachmentFile"); test.setFILECONTENT(attachmentFile.getBytes(1, (int)attachmentFile.length())); That…
p0tta
  • 1,461
  • 6
  • 28
  • 49
1
vote
0 answers

How to handle TCP messages winch are segmented

CONTEXT I'm trying to implement an Android application that use the SoulSeek protocol. The protocol is poorly documented so I have to try and analyses the streams. If you are curious, the link to the documented protocol :…
Sercurio
  • 70
  • 7
1
vote
1 answer

How to know format of file from a bytes-like object?

ORACLE database that I use stores files in the PDF or ZIP format in the BLOB type. I want to save these files. However, I do not know how to recognize when it is a PDF and when it is ZIP? Is it possible to check which file format BLOB stores inside?…
Mozgawa
  • 115
  • 9
1
vote
0 answers

php binary stream parsing performance

I have binary file composed by several (+10k) records of 6 bytes each: As example record a have a byte string like this ÿvDV Ascii : 152 + 118 + 68 + 86 + 27 + 15 Binary: 000100000101101100000010010100110000000000000000 From the string I have to…
Stefano Radaelli
  • 1,088
  • 2
  • 15
  • 35
1
vote
1 answer

Parsing objects out of PDF, objects with byte streams are ignored for some reason?

My current assignment includes taking all of the objects out of the pdf file and then using the parsed out objects. But there is an issue that I have noticed where some of the stream objects are being flat out skipped over by my code. I am…
J. Doe
  • 13
  • 3
1
vote
1 answer

differences and similarities between defaultWriteObject and writeObject of java ObjectOutputStream methods

I'm trying to understand java serialization mechanism, and I have few doubts kindly answer the following questions regarding java serialization: Why we use oos.defaultWriteObject(); ? According to this post its there for backward compatibility.…
amarnath harish
  • 945
  • 7
  • 24
1
vote
1 answer

Python tuple data byte to string easy way?

I'm using socket, struct for receive and unpack the received bytes message via tcp/ip protocol, I'm getting tuple which contains numeric data as well as bytes in the defined order as per contract. The example data as below... Example: receive buffer…
1
vote
1 answer

base64 encoding of extended ascii

I'm receiving binaries from an IoT device. I'm trying to convert some identifier consisting of a list of up to 13 bytes to the smallest readable string possible. For that I've been decoding it to Base64 then convert the bytes to hex so that …
Jeremie
  • 1,267
  • 12
  • 33