Hacker News new | past | comments | ask | show | jobs | submit login

What's the big deal about I/O in Java? I always thought things fit together pretty easily. Just want to read some integers from a file?

  Scanner in = new Scanner(new File(filename));
  while(in.hasNextInt()) {
    ...
  }
How about reading ints over a network connection?

  Socket sock = new Socket("foo", 10101);
  Scanner in = new Scanner(sock.getInputStream());
  ...
If you find yourself reading an entire file into an array, you want to easily access the lines of a file in an iterable fashion, or any of this other stuff, just write a 5 line method once and forget about it. Problem solved. There are features from other languages you can't replicate that easily in Java, but arguing about builtin methods is rather silly.



Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: