Questions tagged [buffer]

A buffer is an area of memory set aside for temporary storage of data while it is being moved from one place to another. This is typically done to speed up processes with significant latency, such as writing to a disk, printer or other physical device. The output is ready to be sent to the device before the device is ready to accept it, so it is moved to the buffer so that the sending program does not have to continue waiting.

A may be used when moving data between processes within a computer. This is comparable to buffers in telecommunication. Buffers can be implemented in a fixed memory location in hardware—or by using a virtual data buffer in software, pointing at a location in the physical memory. In all cases, the data stored in a data buffer are stored on a physical storage medium. A majority of buffers are implemented in software, which typically use the faster RAM to store temporary data, due to the much faster access time compared with hard disk drives. Buffers are typically used when there is a difference between the rate at which data is received and the rate at which it can be processed, or in the case that these rates are variable, for example in a printer spooler or in online video streaming.


References

7035 questions
2
votes
0 answers

ValueError: buffer is smaller than requested size when trying to read a .dta file

dta files I want to convert to csv from .dta as I don't have Stata which is normally used to open the files. When trying to write the file into a variable on opening it I get the error: ValueError: buffer is smaller than requested size Can somebody…
Gideon
  • 21
  • 2
2
votes
1 answer

Are there any c# Protocol buffers tcp messaging libs out there?

Basically i want to pub/sub Protocol buffer messages over a tcp async socket. Are there any open-source libs that pub/sub Protocol buffer messages over tcp? thanks
arkina
  • 991
  • 2
  • 11
  • 17
2
votes
1 answer

How to change buffer size from degrees to distance by meters in PostGIS?

SELECT ST_Buffer(geom, 400) FROM my_table; This query creates a buffer in 400 degrees. How can I change it to have 400m buffers around points? I have tried to use ST_Transform and ST_SetSRID but I got errors. Most likely because I structure my…
markus
  • 81
  • 7
2
votes
3 answers

JS/NodeJS JSON Buffer to String

I am truly struggling to convert a Buffer to a string. For this code let results = await generateRandomNumber(seed); console.log(results); res.status(200).json({ "status": 200, "number": results }); } I receive for the…
2
votes
0 answers

Array bounds error with CryptoStream.Read

I have a server/client system, which encrypts images on the server (python) and decrypts them on the client (c#). The cryptography part is working perfectly, except for trying to decrypt info which is several-blocks long (for example, an image, and…
prodev1
  • 53
  • 7
2
votes
1 answer

How to set Buffer offset range in MongoDB, Its not allowing to upload more than 16MB file in BSON Object?

My Flow and Code: Uploading image from Form Data and storing image's BSON string to Database, below are the steps and code: Uploading file from multer upload Reading file from filesystem - fs Converting image content string to base64…
turivishal
  • 34,368
  • 7
  • 36
  • 59
2
votes
1 answer

Caching audio Buffers to prevent decoding Audio data each time

I am working with audio files where in I upload and each time the audio file is fetched from the server it is represented in the UI with functionality to play/pause etc. I am working with .wav/.mp3 files of duration close to about an hour. The…
2
votes
0 answers

Proper ECS (Unity) Buff/Debuff system structure problem

Modifier = Buff/Debuff I'm currently jumping ship with my project from OOP to ECS. And want to change the old abstract decorate pattern to a new faster ECS one. How the current system works: Base abstract class Modifier has an Update function that…
2
votes
1 answer

Parse buffer image to base64 on React Native

I am trying to show an image gotten from a server in a React Native app. What I am getting in the response look like this: I tried to build a Buffer object using buffer and then parse to base64 const imageBuffer =…
Andres Pino
  • 155
  • 3
  • 9
2
votes
1 answer

Reading from Socket in a loop?

I am creating a server/client TCP in C. The idea is for the server to send a relatively large amount of information. However, the buffer in the client has a size of only 512 (I don't want to increase this size), and obviously, the information sent…
Alcachofra
  • 63
  • 6
2
votes
0 answers

Why doesn't pubsetbuf(0, 0) make my stream unbuffered?

I have been trying to understand buffering as much as possible in C++ (it's amazingly confusing) for a Serial I/O program I'm writing. I originally wasn't flushing my output commands (due to ignorance), so instead I looked up here (How to disable…
polortiz40
  • 391
  • 4
  • 13
2
votes
1 answer

Can reading line buffered streams yield multiple lines?

Given the following setup: child process has been opened for reading (for example via popen()) child's stdout has been set to line buffered (_IOLBF) parent monitors for data on child's stdout (select(), poll() or epoll()) parents reads from child's…
domsson
  • 4,553
  • 2
  • 22
  • 40
2
votes
1 answer

glMapBufferRange returns null and produces a GL_INVALID_ENUM?

OpenGL ES 3.0 here. I am trying to read back the contents of a TRANSFORM_FEEDBACK buffer like this: GLES30.glBindBufferBase(GLES30.GL_TRANSFORM_FEEDBACK_BUFFER, 0, tfo ); GLES30.glBeginTransformFeedback(…
Leszek
  • 1,181
  • 1
  • 10
  • 21
2
votes
4 answers

Possible improvements to Java's ArrayList/Scala's ArrayBuffer?

Currently, the "growing" algorithm figures out that the Array backing the ArrayList/ArrayBuffer is too small for the requested operation and copies the contents to the beginning of a larger array. jsuereth explains it very well in the comments of…
soc
  • 27,983
  • 20
  • 111
  • 215
2
votes
1 answer

Android ByteArrayOutputStream Base64.encodeToString save to Server as Image, How?

In android studio I used this code to convert image to byte array and send to server: Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); ByteArrayOutputStream baos = new…
Ahmad Ebrahimi
  • 267
  • 5
  • 24