Input/Output of data to/from a system. This usually implies file storage or network communication, but may also mean interaction with a user through a user interface.

learn more… | top users | synonyms

1
vote
0answers
61 views

Using streams as method parameters and/or return types

So let's say I have a 'Transformer' interface that can transform one file-type to another. Let's say I also wish to use streams to provide the data to the Transformer. Which is the approach that is ...
3
votes
2answers
146 views

What is a stream, and how does it work?

Like a data stream in general, this can be an I/O stream or memory stream or a file stream or what not. I understand that it's some sort of stream of bytes, that you can read to parse very large ...
1
vote
1answer
54 views

What is the best way to handle dynamic content?

So we run a site where there are elements of the interface that could potentially be changed at any moment in the backend. Specifically we run a web service where certain functions are loaded ...
3
votes
4answers
130 views

Structuring an input file [closed]

I am in the process of structuring a small program to perform some hydraulic analysis of pipe flow. As I am envisioning this, the program will read an input file, store the input parameters in a ...
2
votes
5answers
3k views

Sharing buffer between multiple threads

I had a job process that was executing a lot of IO to read and write temporary files. Now I want to (need to) reduce the quantity of IO executions. So I want to create a sort of circular buffer ...
0
votes
1answer
305 views

Comparing performance of different C++ self-made tree data structures

I have two tree data-structures that I made in C++ , and they give a response for range queries/point queries in that program. I am using Ubuntu. I need help in understanding the way to compare the ...
4
votes
3answers
334 views

Generic and type safe I/O model in any language

I am looking for an I/O model, in any programming language, that is generic and type safe. By genericity, I mean there should not be separate functions for performing the same operations on different ...
1
vote
2answers
286 views

Python reading from stdin while doing other tasks

I am trying to write a system log parser. It will receive messages from the FreeBsd syslog daemon through stdin. It will use those messages to determine if an ip should be banned or not. The problem ...
1
vote
3answers
150 views

Is it better to save output from command in memory and store later or save in a temporary file and then move to final location?

I hope this is not off topic. I have to save output from a command to file, but only if length of this output is positive. I've thought about two solutions: save output to a python variable, check ...
2
votes
1answer
96 views

creating simple states for a stateless input

Given an input device (basically a keyboard) that reports keyup and keydown, how may I most efficiently store and retrieve information about which keys are currently depressed? My first thought was a ...
1
vote
3answers
276 views

Disk I/Os incurred by readLine () in Java

Does readLine() Java function used with BufferedReader cause one disk I/O per call? If yes, is there any way to read specific number of lines, say n, from a text file causing only one disk I/O? ...
0
votes
1answer
1k views

I/O interface for portable library

I'm writing a new .NET portable library that can read a file format, and file I/O is not available for portable libraries. The article "How to Make Portable Class Libraries Work for You" states that ...
5
votes
1answer
125 views

Name convention for Reader and Writer [closed]

I'm trying to name a component that will be capable of both reading from an InputStream (file or otherwise), and writing to an OutputStream; thus serving both as a Reader and as Writer. So far the ...
1
vote
1answer
454 views

Using assembly to write to a file

I am working with a trading application (reading data from the exchange) which generates a bucket load of data on a per second basis. We have different "log-levels" but even the minimal log-level ...
1
vote
1answer
72 views

Need some input on storing stdin, stdout, stderr information for debugging

I am working with a legacy system that is not too bad, but I thought of making some improvements to it, and I wanted to solicit your feedback to help me make good decisions. The platform is Linix ...
37
votes
5answers
3k views

Critique of the IO monad being viewed as a state monad operating on the world

The IO monad in Haskell is often explained as a state monad where the state is the world. So a value of type IO a monad is viewed as something like worldState -> (a, worldState). Some time ago I ...
9
votes
1answer
327 views

Model-View-Controller (MVC) Which component handles save/load operations?

In a traditional MVC application, which component (model, view, or controller) is responsible for reading/writing the model to/from disk?
1
vote
3answers
1k views

What is preferred for file I/O in Java?

Of the three BufferedReader/Writer Binary Streams Channels which is more preferred in real life for file I/O in Java and why? I prefer channels for binary data to be put into file or read from ...
16
votes
5answers
1k views

At what point is asynchronous reading of disk I/O more efficient than synchronous?

Assuming there is some bit of code that reads files for multiple consumers, and the files are of any arbitrary size: At what size does it become more efficient to read the file asynchronously? Or to ...
2
votes
1answer
183 views

Where do you use Java Channels?

I have only used Java Channels and BufferedOutputStream and the input counter part for reading and writing simple integers and some strings here and there to the file. However I do not understand the ...
0
votes
1answer
2k views

How are Java ByteBuffer's limit and position variable's updated?

There are two scenarios: writing and reading Writing: Whenever I write something to the ByteBuffer by calling its put(byte[]) method the position variable is incremented as: current position + size of ...
2
votes
1answer
60 views

Reading data from file and const

Is it sane to let a read method on a file object to be const? For example size_t read(void* buffer,size_t length) const; The read method does not change the contents of the file, but updates the ...
2
votes
2answers
973 views

Abstracting a zip as a filesystem - C++ [closed]

I would like to access in read and write mode to a zip without decompressing it on disk: what options do I have? I need to perform the usual IO actions reserved for a filesystem like reading, writing ...
5
votes
1answer
345 views

Design pattern for an automated mechanical test bench

Background I have a test fixture with a number of communication/data acquisition devices on it that is used as an end of line test for a product. Because of all the various sensors used in the ...
0
votes
3answers
220 views

Reading input all together or in steps?

For many programming quizzes we are given a bunch of input lines and we have to process each input , do some computation and output the result. My question is what is the best way to optimize the ...
3
votes
1answer
1k views

How to read from a database, and write to a file asynchronously / non blocking way in Java

I'm trying to modify a serial program that reads from a database, and writes results to a file, this is done in a blocking way and I think we can get performance boost of there is a memory buffer and ...