All Questions
382
questions
0
votes
1
answer
54
views
How to make async I/O more efficient?
I am using the following method to read from a very large file and write the results to a new file.
The amount of data read from the input file and written to a new file can very wildly, from a few ...
0
votes
0
answers
35
views
Implement a minimum flush size for io.BufferedWriter in Python
I'm extending the BufferedWriter class from the io module and so far it looks something like this:
class MyBufferedWriter(io.BufferedWriter):
@classmethod
def open(cls, config, buffer_size=...
1
vote
0
answers
50
views
Read the DB using stream in android ROOM
I have an android app to read room database and export it to json.
It spend memory very much. I just wanna use stream or any other solution so that it doesn't need to load entire data in memory.
...
0
votes
1
answer
89
views
How to "fork" an AsyncReader into two in Rust?
I'm currently working on implementing a TCP proxy in Rust that can detect the server name in HTTPS connections and decide which proxy to use based on it. Specifically, I need to copy data from a ...
3
votes
1
answer
73
views
What is the canon/standard name for file handle/stream/file stream of Lua?
I noticed that the thing that is returned by io.open() is called differently. I wonder what the canon name is.
in Lua 5.4 Reference Manual, it's called a "file handle".
in "Programming ...
1
vote
2
answers
407
views
Trying to understand Java I/O and streams [closed]
Very new to coding and Java, and I'm trying to wrap my head around streams.
My textbook says that "a stream is linked to a physical device by the Java I/O system." What do they mean when ...
0
votes
0
answers
32
views
Buffered-Input Stream [duplicate]
The below line is from the java documentation.
"Buffered input streams read data from a memory area known as a buffer; the native input API is called only when the buffer is empty. Similarly, ...
0
votes
1
answer
141
views
The right way to migrate a code using Win32 API functions ReadFile and WriteFile to Linux
I have a custom stream implementation that uses Win32 API functions like ::CreateFile2, ::ReadFile, ::WriteFile. Also the stream implements Flush and Truncate functions that are not supported by std::...
0
votes
0
answers
34
views
Notepad changes the control characters when a StreamWriter accesses the file
When I open Notepad regulary in my windows 10 machine the control characters are the following
but when I say:
Console.OutputEncoding = Encoding.UTF8;
Console.InputEncoding = Encoding.UTF8;
...
0
votes
1
answer
135
views
How I do convert a Julia stream to "byte content" for a Python package?
I maintain OdsIo.jl, a Julia package that wraps, for ods files specifically, ezodf, a Python package for various OpenDocument formats,
My "ods_readall" function starts by calling ezodf....
0
votes
0
answers
25
views
print double with variable number of decimals [duplicate]
Sometimes I need double to be printed with 1 decimal (when it has the same value as integer), sometimes I need double to be printed with 6 decimals.
For example:
0.000 should be printed as 0.0
1....
1
vote
1
answer
460
views
Selecting a particular Column in a CSV-file Dynamically
I have this CSV file:
id,name,mark
20203923380,Lisa Hatfield,62
20200705173,Jessica Johnson,59
20205415333,Adam Harper,41
20203326467,Logan Nolan,77
And I'm trying to process it with this code:
try (...
0
votes
1
answer
99
views
Getting last value printed twice when reading file in c++ [duplicate]
I'm new to c++. Currently I'm learning how to read and write to a file. I've created a file "nb.txt" with content like this:
1 2 3 4 5 6 7
2 3 4 5 6 7 9
I'm using a simple program to read ...
0
votes
0
answers
66
views
What are good general techniques to extract the last n bytes from a stream of input
Assuming I have a binary stream of input bytes of unknown length that end with an identifiable EOF-like condition, what are some algorithms to extract the last, say 8 bytes and process them ...
1
vote
1
answer
301
views
How to merge python IO streams into a single iterator, but maintain which item comes from which stream?
The desired functionality is something along the following:
import subprocess as sp
p = sp.Popen(('program', 'arg1', ...), stdout=sp.PIPE, stderr=sp.PIPE)
for line in merge_streams((p.stdout, 'OUT'),...