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

Lectures

  • Reviews
  • About us
  • CS50
Start
Start learning
Start learning
  • My progress
  • Courses
  • Quest map
  • Lectures
  • How to think in bytes and why ByteArray is needed

    Kotlin SELF
    43 level,0 lecture
    A lecture about a “mindset shift” in I/O: a file is first and foremost bytes, and text is only an interpretation. We break down when readText() is not suitable and why binary data needs ByteArray, how the Byte type works (range - 128 .. 127), why a buffer is needed, and why arrays are compared via contentEquals rather than the == operator. Plus, a bridge between the String and byte worlds via encodeToByteArray()/ decodeToString().
    Open
  • Working with bytes: readBytes() / writeBytes()

    Kotlin SELF
    43 level,1 lecture
    We go through the shortest path “read file → write file” for binary data in Kotlin/JVM: the extension functions File.readBytes() and File.writeBytes(bytes), working with the ByteArray type, validating the result by size ( length()) and byte-by-byte comparison ( contentEquals()), as well as the limitations of the “read all at once” approach and typical mistakes (for example, comparing arrays via == and reading a binary file as text).
    Open
  • File streams: FileInputStream/FileOutputStream, EOF, and use

    Kotlin SELF
    43 level,2 lecture
    We break down low-level file work on the JVM via byte streams: how to read and write data using FileInputStream/ FileOutputStream, why InputStream.read() returns Int and what -1 (EOF) means, how to correctly connect the result of read(buffer) with write(buffer, 0, n), and why use {} is a must-have habit for closing resources.
    Open
  • Buffering and chunk copying

    Kotlin SELF
    43 level,3 lecture
    We break down why copying “byte by byte” via read()/ write() is usually slow, how “our” buffer ByteArray differs from wrappers like BufferedInputStream/ BufferedOutputStream, what the contract of read(buffer) is (the n value and -1 on EOF), and what the canonical chunk-copy loop with output.write(buffer, 0, n) looks like. At the end: choosing a buffer size, a data flow diagram (mermaid), and common mistakes.
    Open
  • ZIP archives: ZipEntry, reading/writing

    Kotlin SELF
    43 level,4 lecture
    We look at ZIP on the JVM as a streaming “container” of entries: what ZipEntry stores (primarily the name and the directory flag), how to correctly write an archive via ZipOutputStream ( putNextEntry() → write bytes → closeEntry()), how to read via ZipInputStream (iterate nextEntry) and unpack safely, protecting against paths like ../../secret.txt. At the end — a mini CLI and typical mistakes.
    Open
Learn
  • Registration
  • Java course
  • Help with tasks
  • Pricing
Community
  • Users
  • Articles
  • Forum
  • Chat
  • Success stories
  • Activities
Company
  • About us
  • Contacts
  • Reviews
  • FAQ
  • Support
JavaRushJavaRush — is an interactive online course for learning Java programming from scratch. It contains 1200 practical tasks with one-click solution checking, the necessary minimum of theory on Java basics, and motivating features that help you complete the course: games, quizzes, interesting projects and articles on effective learning and the career of a Java developer.
Follow us
Язык интерфейса
Русский
English
Українська
"Programmers are not born" © 2026 JavaRush
MastercardVisa
"Programmers are not born" © 2026 JavaRush