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

Reducing the initial delay when playing remote video content

Hi using MPMoviePlayerController to stream video into the app. However, it takes a long time to load and I want to be able to pre-buffer the video. Any suggestions?
user421704
  • 31
  • 2
  • 4
2
votes
4 answers

IPFS Pinata service not accepting file

I have a code as shown below that uploads files from the browser and saves in the server, once it has been saved to the server, I want the server to connect to the Pinata API so the file can also be saved to the IPFS node. let data = new…
Keenlabi
  • 163
  • 1
  • 2
  • 11
2
votes
1 answer

How to pick a file I/O buffer size for reading a file in Windows?

While investigating some slow performance in my application while reading a file over a WAN, I noticed that copying that file in Windows Explorer was significantly faster. Some further investigation with Process Monitor revealed the cause: my…
Josh Kelley
  • 56,064
  • 19
  • 146
  • 246
2
votes
1 answer

How to convert IoSliceMut array into Vec?

let mut buffer = Vec::with_capacity(10); stream.read_vectored(&mut buffer); The code above turns buffer into an IoSliceMut vector, but I don't know how to read from this vector or how to convert it back into a Vec.
2
votes
1 answer

can we customize the file open buffer size in Julia

open() sets a memory buffer as defined by io.h: IOS_BUFSIZE = 32kb (previously 128kb) Is it possible to change that value (future open kwargs?) or adapt it to disk blocksize (often very large in GPFS, etc)?
garciaes
  • 21
  • 3
2
votes
1 answer

How can I create a buffer which Python would not free?

I need to call a function in a C library from python, which would free() the parameter. So I tried create_string_buffer(), but it seems like that this buffer would be freed by Python later, and this would make the buffer be freed twice. I read on…
Henry Hu
  • 524
  • 4
  • 12
2
votes
2 answers

Powershell Pipeline data to external console application

I have a console application which can take standard input. It buffers up the data until the execute command, at which point it executes it all, and sends the output to standard output. At the moment, I am running this application from Powershell,…
Mark Bertenshaw
  • 5,594
  • 2
  • 27
  • 40
2
votes
1 answer

How is there no flush in FileReader, but there is for FileWriter?

Say I try to run this code: FileWriter fw = new FileWriter("a.txt"); fw.write("A"); It wouldn't work as data is buffered and won't be auto flushed until it reaches max buffer size. So we flush manually with fw.flush();, after which this would…
Stefan
  • 969
  • 6
  • 9
2
votes
1 answer

reading in large text files for parsing

I am working with a few text files that range from 1-2 Gig in size. I cannot use the conventional streamreader and decided to read in chuncks and do my work. The problem is that I am not sure when the end of the file is reached since it has been…
vbNewbie
  • 3,291
  • 15
  • 71
  • 155
2
votes
1 answer

How can I name/rename a terminal buffer?

Is there a way to rename the terminal buffer? using :b to switch buffers, terminal buffers are often shown as !/usr/local/bin/fish and !/usr/local/bin/fish (1) which isn't very useful. Ideally It could auto rename itself, but I'm also okay with…
Oguz Bilgic
  • 3,392
  • 5
  • 36
  • 59
2
votes
3 answers

How do I convert a buffer to a binary string in c++?

I am trying to convert an arbitrary buffer to a string of its binary representation. I was looking at some code from here: http://snippets.dzone.com/posts/show/2076 in order to get started. I realize that this code can not convert an arbitrary…
2
votes
1 answer

NameError: name 'buffer' is not defined

Python2 code: x = buffer(chr(0) * 32) What is the python3 equivalent? I tried to replace buffer with memoryview() but than name error becomes a type error: TypeError: memoryview: a bytes-like object is required, not 'str'. I'm pretty sure that this…
python3.py
  • 41
  • 1
  • 4
2
votes
1 answer

Is ZeroMemory the windows equivalent of null terminating a buffer?

For example I by convention null terminate a buffer (set buffer equal to zero) the following way, example 1: char buffer[1024] = {0}; And with the windows.h library we can call ZeroMemory, example 2: char buffer[1024]; ZeroMemory(buffer,…
asd23553
  • 47
  • 1
  • 6
2
votes
1 answer

NodeJS consuming Transfer-Encoding chunked using https.request

I'm making a GET request to an API that responds with Transfer-Encoding: chunked. It's an https request, I've attached on('data') listener to it which then adds the response to an array. There are around 5 chunks incoming each of them being a Buffer…
Kamil Oczkowski
  • 125
  • 2
  • 9
2
votes
1 answer

C process printing twice after fork() even though it's inside the parent process and I flush stdout

I'm working on a C project for school that involves using shared memory but I can't seem to figure out why the parent process is printing the results twice after the fork. I flush the stdout after the print, but it still prints twice. Heres my…
Justin Cabral
  • 565
  • 1
  • 6
  • 20