Questions tagged [io]

In computing, input/output, or I/O, refers to the communication between an information processing system (such as a computer), and the outside world, possibly a human, or another information processing system.

In computing, input/output, or I/O, refers to the communication between an information processing system (such as a computer), and the outside world, possibly a human, or another information processing system.

(Source: Wikipedia [Input/Output])


I/O includes tasks such as:

  • Reading and writing files ()
  • Interacting with a user through a command-line terminal session ( / / )
  • Connecting programs so that one sends its output to the next (s)
  • Sending data over a network in packets or as a data stream ()

For the Io language, see

17482 questions
6
votes
5 answers

Use cases of PipedInputStream and PipedOutputStream

What are use cases of Piped streams? Why just not read data into buffer and then write them out?
Illarion Kovalchuk
  • 5,774
  • 8
  • 42
  • 54
6
votes
1 answer

URLConnection low level byte counting

I'm trying to obtain the lowest level of byte counting possible with URLConnection. I already went to count the data passing by the two streams, with CountingInputStream and CountingOutputStream from the Apache Commons IO but the byte counting I get…
galex
  • 3,279
  • 2
  • 34
  • 46
6
votes
1 answer

How do I read Windows NTFS's Alternate Data Stream using Java's IO?

I'm trying to have my Java application read all the data in a given path. So files, directories, metadata etc. This also includes one weird thing NTFS has called Alternate Data Stream (ADS). Apparently it's like a second layer of data in a directory…
Pt. Terk
  • 462
  • 4
  • 13
6
votes
3 answers

java read / write construction

Can someone explain me why this construction wont work: while (fileInputStream.available()>0) { fileOutputStream.write(fileInputStream.read()); } and this one works just fine: while (fileInputStream.available()>0) { int data =…
Hikaru
  • 111
  • 8
6
votes
1 answer

Why does MemoryStream not offer a constructor taking a "long" capacity?

According to .NET MemoryStream - Should I set the capacity?, it's preferred to set the initial capacity of a MemoryStream if you know it beforehand. In my code, I'm receiving (from a third party library) a Stream object. This Stream is wrapped…
Matias Cicero
  • 25,439
  • 13
  • 82
  • 154
6
votes
1 answer

BytesIO object to image

I'm trying to use Pillow in my program to save a bytestring from my camera to a file. Here's an example with a small raw byte string from my camera which should represent a greyscale image of resolution 10x5 pixels, using LSB and 12bit: import…
smiddy84
  • 285
  • 1
  • 4
  • 13
6
votes
1 answer

A way to strip returned values from java.io.File.listFiles in Clojure

I call a java function in Clojure to get a list of files. (require '[clojure.java.io :as io]) (str (.listFiles (io/file "/home/loluser/loldir"))) And I get a whole bunch of strings like these # etc. How do I get…
implmentor
  • 1,386
  • 4
  • 21
  • 32
6
votes
2 answers

How to check if a file is currently open or being written to in .NET?

I am trying to determine whether or not a file is currently open or being written to using C#. I've seen similar SO questions, all with a similar solution as my code, which attempts a File.Open on a file. But when I run the program with the code…
kyle_13
  • 1,173
  • 6
  • 25
  • 47
6
votes
5 answers

Writing To A File With Multiple Streams C#

I am trying to download a large file (>1GB) from one server to another using HTTP. To do this I am making HTTP range requests in parallel. This lets me download the file in parallel. When saving to disk I am taking each response stream, opening the…
shortspider
  • 1,045
  • 15
  • 34
6
votes
1 answer

Using Pipes to read and write binary data in Haskell

I am trying to read and write very many ints in constant memory. I have figured out how to write the ints to memory but have not figured out how to read them back. import Control.Lens (zoom) import System.IO (IOMode(..), withFile) import…
Justin Raymond
  • 3,413
  • 2
  • 19
  • 28
6
votes
1 answer

SourceKitService sucking memory and grinding all processes to a halt

I am having a lot of trouble with stupid SourceKitService. It is taking up like 20GB of memory sometimes and just means my lapTop is pretty much useless it is so slow. I am using xCode 6.4 and working in Swift. I am working on a large project so I…
villy393
  • 2,985
  • 20
  • 28
6
votes
3 answers

Read an arbitrary number of bytes from type implementing Read

I have something that is Read; currently it's a File. I want to read a number of bytes from it that is only known at runtime (length prefix in a binary data structure). So I tried this: let mut vec = Vec::with_capacity(length); let count =…
musiKk
  • 14,751
  • 4
  • 55
  • 82
6
votes
2 answers

strlen not giving correct string length C

I am reading from my dictionary and printing out the word + the length of the word for testing purposes. I use strlen to get the length of the string. However, the numbers I got are not correct. I believe strlen doesn't count the \0 character. I am…
PTN
  • 1,658
  • 5
  • 24
  • 54
6
votes
1 answer

Different Results on Different System

When I use this code at my home PC, it gives the output as "output1" ,But when i use the same code at my office PC gives a different output as "output2". code: System.out.println(System.getProperty("java.io.tmpdir")); Output 1:…
Kanak Shukla
  • 229
  • 1
  • 4
  • 11
6
votes
0 answers

How to avoid tcdrain() from blocking forever

I have this function _write_port() being called from a thread, whenever I need to send a message. To ensure the whole message is written, tcdrain() is used. void Serial_Port::_write_port(char *buf, unsigned &len) { // Lock …
jose
  • 220
  • 1
  • 12