Jump to content

Java Understanding

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
DozyLa

DozyLa

    Newbie

  • Members
  • Pip
  • 2 posts
What abstract base classes are used for character streams and for byte streams?

-DozyLa

#2
ArekBulski

ArekBulski

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,376 posts
I don't know Java, sorry, maybe search in google for it? I found this page which says:

All byte stream classes are descended from InputStream and OutputStream.

Byte Streams (The Java™ Tutorials > Essential Classes > Basic I/O)

#3
DozyLa

DozyLa

    Newbie

  • Members
  • Pip
  • 2 posts
I did search in Google...it came up with nothing, which was quite annoying.

#4
ArekBulski

ArekBulski

    Speaks fluent binary

  • Members
  • PipPipPipPipPipPipPipPip
  • 1,376 posts
Sorry to hear that. Did the website and page I found was helpful?

#5
Stu_328

Stu_328

    Learning Programmer

  • Members
  • PipPipPip
  • 92 posts
The base abstract classes for reading and writing bytes of data are java.io.InputStream and java.io.OutputStream respectively.

The base abstracts for reading and writing CharSequences, char[]s and their derivatives are java.io.Reader and java.io.Writer.

Use this for looking up the java API:
Java Platform SE 6

To write a string to some io destination could be done as follows:
BufferedWriter bW = new BufferedWriter(new FileWriter(new File("blurb.txt")));
bW.write("Curve, Base NPV, Shifted NPV, Pvbp");
bW.newLine();
bW.flush();
bW.close();

HTH