Institute of Computer Science
  1. Courses
  2. 2018/19 spring
  3. Object-Oriented Programming (Narva College) (LTAT.NR.003)
ET
Log in

Object-Oriented Programming (Narva College) 2018/19 spring

  • Home
  • Materials
  • Java Glossary
  • Source Example
  • Cheat sheet (S1-S6)
  • Grading
  • Links

Before session 10

Streams

Objectives:

After completing the session, a student can:

  • create, modify and delete files and folders, using the class File;
  • write bytes to a file and read them back from the file, using FileOutputStream and FileInputStream;
  • write text data to a file and read them back from the file, using OutputStreamWriter and InputStreamReader;
  • write text data to a file and read them back from the buffer, using BufferedOutputStream and BufferedInputStream;
  • write values of primitive data types to a file and read them back from the file, using DataOutputStream and DataInputStream.

Streams are used together with exceptions. Exceptions will be explained in details next week. Hereof, please add into the methods' signature the following two words - throws Exception.

Topics

  • 10.1 Introduction
  • 10.2 Byte streams
  • 10.3 Character streams
  • 10.4 Buffered streams
  • 10.5 Data streams
  • 10.6 Some tricks with streams
  • 10.7 Tasks

Cheat sheet

  • Java IO
  • Java I/O presentation
  • Java I/O examples

Alternative materials

  • in English: H. Schildt.‎ Java - The Complete Reference: Chapter: 13
  • in Estonian: here
  • in Russian: Г. Шилдт. Java 8. Полное руководство: Chapter: 13

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment