Hello.

In Java, for work with streams, the InputStream , OutputStream classes and their heirs are provided.

Recently, I discovered that in parallel there are classes Reader and Writer , which at first glance duplicate each other. What are they needed for? And how do they differ? When what to use? :)

  • these are old classes - Gorets
  • InputStream, OutputStream - obsolete? - wwvv
  • reader and writer, it is preferable to use io / out stream - Gorets
  • one
    > reader and writer, it is preferable to use i / o stream why do you think so? - jmu
  • I advise you to read about the decorator pattern - Viacheslav

1 answer 1

Reader/Writer read / write character by character, InputStream/OutputStream byte

  • one
    It is worth adding that in most cases their buffered versions are used: BufferedReader / Writer - jmu