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

why do we need ArrayBuffer

I am trying to understand ArrayBuffer. It seems like that if we use uint8Array directly, we get everything we need(typed array with fixed type). We can do something like this: var a = new Uint8Array(2) a[0] = 10 a[1] = 20; we can even do this =…
Nika Kurashvili
  • 6,006
  • 8
  • 57
  • 123
2
votes
1 answer

What happens to the extra characters in the fgets() buffer that are over the bounds check?

#include int main() { char arr[10]; printf("Enter your name: \n"); fgets(arr, sizeof(arr), stdin); puts(arr); return 0; } I have a char arr[10] and use fgets(arr, sizeof(arr), stdin) to receive input. If I input say…
rain
  • 45
  • 3
2
votes
1 answer

Unexpected result when using the hex encoding on Buffer object

All private keys listed have been changed and they are addresses on a test network anyway so don't get any ideas! The issue: I'm attempting to use the Hex encoding of a Buffer object, however, when I try and use the Buffer.from(key, 'hex') function,…
Ben
  • 117
  • 3
  • 10
2
votes
1 answer

Qt MediaPlayer play audio from memory

I'm developing music player for Symbians and need to play raw audio data (PCM) from phone memory. I tried QAudioOutput, which works fine (through Qbuffer - iherits QIODevice), but it is too much low-level API and therefore not suitable for me. So I…
Samuel
  • 2,430
  • 5
  • 31
  • 41
2
votes
2 answers

NodeJS Converting text buffer to viewable HTML Page

I am receiving data reading from an S3 bucket, which will contain .html files. they are being received by Node like so: {"type":"Buffer","data":[60,104,116,109,108,32,120,109,108,110,115,58,118,61,34,117,114 ....]} Is there any way you can take this…
kt-workflow
  • 359
  • 1
  • 3
  • 14
2
votes
2 answers

How can I access capture buffers in brackets with quantifiers?

How can I access capture buffers in brackets with quantifiers? #!/usr/local/bin/perl use warnings; use 5.014; my $string = '12 34 56 78 90'; say $string =~ s/(?:(\S+)\s){2}/$1,$2,/r; # Use of uninitialized value $2 in concatenation (.) or string…
sid_com
  • 24,137
  • 26
  • 96
  • 187
2
votes
2 answers

how does the php output buffer work (problem using $_SERVER['REQUEST_TIME'] to calculate script execution time)

i really didnt know how to word the title so i did the best i could. we have an issue where we calculate final script (web based) execution time. we do a simple if(time()-$_SERVER['REQUEST_TIME']>X){ logMe(); } we find that sometimes the script…
anonymous-one
  • 14,454
  • 18
  • 60
  • 84
2
votes
3 answers

How to polylfill Buffer for jsonwebtoken in Wepack 5

I am upgrading to Webpack 5 and I have an issue with the package jsonwebtoken (https://github.com/auth0/node-jsonwebtoken) that needs Buffer (at https://github.com/auth0/node-jsonwebtoken/blob/master/sign.js#L91) Since Webpack 5 polyfills are not…
Ant1
  • 344
  • 5
  • 12
2
votes
1 answer

Get .NET Process object to flush input stream continously?

I am trying to change my class library that talks to the Mercurial command line client, and new in the 1.9 client is the ability to spin up a server and talk to it over the standard input/output pipes. This is really promising since one of the major…
Lasse V. Karlsen
  • 380,855
  • 102
  • 628
  • 825
2
votes
0 answers

VIDIOC_QBUF: Invalid argument V4l2 MEMORY USERPTR python implementation

I am trying to work with user-pointer v4l2 driver. Currently I am working with the v4l2 MMAP and its working fine, but I want to change it to user pointer because of reading performance. Working example (with mmap): def init_mmap(self, width=8192,…
2
votes
1 answer

extract mean value of raster with buffer condition on second layer/attribute

I have this stars object (could be also formatted to raster): stars object with 2 dimensions and 2 attributes attribute(s): LST_mean elevation Min. :14.98 Min. :296.0 1st Qu.:16.89 1st Qu.:346.9 Median :17.64 Median…
2
votes
2 answers

glmapbufferOES and glunmapbuffer undeclared in opengl-es 2.0

I am doing coding in ubuntu 10.10 with kronos headers but i am stuck because whenever i try to compile the code they there is an error comes : glmapbuffer undeclared glunmapbuffer undeclared i have gl2.h and gl2ext.h in my header file .Can anyone…
Sudhanshu Gupta
  • 2,255
  • 3
  • 36
  • 74
2
votes
2 answers

Which is the common-average buffer size for InternetReadFile?

I use WinInet.h in Delphi to download files over HTTP with the average size between 30 KB and 1.5 MB. var Buf: array[0..BUFFER_SIZE - 1] of Byte; while BOOL(InternetReadFile(hUrl, @Buf, SizeOf(Buf), BytesRead)) and (BytesRead > 0) do if…
Gad D Lord
  • 6,620
  • 12
  • 60
  • 106
2
votes
1 answer

Installing Node.js 15.5.1 (latest version) results in error

I tried to install Node js 15.5.1 (latest version) and this error occurred: (node:13440) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.allocUnsafe() instead I downloaded the…
2
votes
1 answer

double buffer video in assembler

I'm trying to do the double buffer video in assembler, but in this case i have a problem, i don't know how to solve it , it can't close after a key is pressed. Apparently the problem is in inc di: (I'm trying to paint all the 320*200 pixel with…
Daniel Flores
  • 770
  • 3
  • 12
  • 31