JavaRush
AI Academy
new
Promotion
Learning
Courses
Tasks
Quizzes
Games
Help
Schedule of nudges
Internship
Community
Users
Forum
Chat
Articles
Activities
Reviews
Subscriptions
Light theme

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • BufferedReader, BufferedWriter: buffering, advantages

    JAVA 25 SELF
    36 level,0 lecture
    Why reading and writing files “with a teaspoon” is expensive: we’ll break down how buffering speeds up text I/O in Java. We’ll see how BufferedReader and BufferedWriter work on top of FileReader/ FileWriter, use line-by-line reading via readLine(), writing and newline via write()/ newLine(), explicit flushing with flush(), set the buffer size, and deal with encodings via InputStreamReader/ OutputStreamWriter. When to apply buffering, when not — and which mistakes happen most often.
    Open
  • Reading text files: line by line and all at once

    JAVA 25 SELF
    36 level,1 lecture
    This lecture covers line-by-line reading with BufferedReader and whole-file reading via Files.readAllLines/ Files.readString, choosing a buffer (for example, 8192 bytes), safe resource closing with try-with-resources, and working with charsets ( StandardCharsets.UTF_8). It includes practical examples (counting lines, searching logs, parsing configuration) and common pitfalls (for example, OutOfMemoryError when loading large files at once).
    Open
  • Reading and writing binary files: InputStream, OutputStream

    JAVA 25 SELF
    36 level,2 lecture
    We cover the difference between text and binary files, the basic byte streams InputStream/ OutputStream and their file implementations ( FileInputStream, FileOutputStream). We write buffered copy, discuss read speed one byte at a time vs in blocks, writing byte arrays via write(), try-with-resources nuances, choosing a buffer size of 4– 16 KB, safe use of readAllBytes(), and common pitfalls (for example, using FileReader/ FileWriter for binary data).
    Open
  • DataInputStream, DataOutputStream: working with primitives

    JAVA 25 SELF
    36 level,3 lecture
    In this lecture, we examine binary I/O in Java using DataInputStream and DataOutputStream: how to write and read primitives ( int, double, boolean) and strings ( String) with writeXXX/ readXXX methods, why order matters, how to store arrays, when it makes sense to add BufferedInputStream/ BufferedOutputStream, and which common mistakes lead to IOException or EOFException.
    Open
  • Using try-with-resources: automatic resource closing

    JAVA 25 SELF
    36 level,4 lecture
    We break down the modern way to handle resources safely in Java — try-with-resources: a comparison with the old try/ catch/ finally + close() pattern, type requirements (implementing AutoCloseable or Closeable), the try(...){...} syntax, close order, “suppressed” exceptions via getSuppressed(), examples with I/O streams and custom resources, as well as tips and common mistakes.
    Open
Courses
  • Java Course
  • Python Course
  • Development with Claude Code
  • All 16 courses
University
  • Java FullStack
  • Python FullStack
  • AI Native Developer
  • Web FullStack
Community
  • Articles
  • Forum
  • Help with Tasks
Company
  • About us
  • Contacts
  • Reviews
  • Pricing
  • Questions and answers
JavaRush JavaRush: online courses in Java and other programming languages, where you learn by solving tasks. We started in 2012 with a Java course, and today there are 16 courses: Java and Spring, Python, web development, SQL, Go, C#, C++, Kotlin, Swift, Docker and AI development. More than 10,000 tasks with instant checks, and the first level of any course is free. Learn on your own or with a mentor at JavaRush University.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy
MastercardVisa
"Programmers are not born" © 2026 JavaRush Terms of Use and Privacy policy