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
  • Binary serialization pitfalls: security, compatibility

    JAVA 25 SELF
    45 level,0 lecture
    In this lecture we examine the risks of binary serialization in Java: why deserialization from untrusted sources is dangerous (“gadget chains”, RCE), what threats special methods like readObject and readResolve pose, and how to defend yourself (whitelisting, opting for JSON/ XML, safe libraries such as Jackson). We will look in detail at class version compatibility and the role of the serialVersionUID field, behavior on InvalidClassException, the constraints of transient/ static, performance, as well as best practices and common mistakes.
    Open
  • Serialization of generic collections: specifics

    JAVA 25 SELF
    45 level,1 lecture
    We analyse how type erasure ( type erasure) affects serialization of generic collections: why at runtime List<String> and List<Integer> are the same ArrayList, what exactly is written and read via ObjectOutputStream/ ObjectInputStream, where ClassCastException and warnings about unchecked casts come from. We will show examples with nested collections, Map/ Set, mention Gson/ Jackson, and formulate practices for safe deserialization.
    Open
  • Compatibility and backward compatibility in serialization

    JAVA 25 SELF
    45 level,2 lecture
    We break down how to evolve serializable classes without breaking data: why you should fix serialVersionUID, how the JVM checks compatibility, which changes are safe (adding/removing fields) and which are critical (type changes, moving a class to another package). We’ll show the role of transient/ static, custom serialization techniques via writeObject/ readObject, how binary serialization differs from XML/JSON, strategies to ensure compatibility, and common pitfalls (for example, InvalidClassException).
    Open
  • Migration and versioning of serialized data

    JAVA 25 SELF
    45 level,3 lecture
    How to safely evolve serializable classes in production: what happens when fields and types change, how class versioning works via serialVersionUID, when to change it and when to keep it, how to apply “lazy” migration via readObject/ readFields and in-place conversion, and what advanced techniques exist such as ObjectInputStream.readClassDescriptor(). We will go through a complete practical scenario with two class versions and typical mistakes, including traps like InvalidClassException.
    Open
  • Compression and profiling of serialization

    JAVA 25 SELF
    45 level,4 lecture
    How to reduce size and speed up object serialization in Java: exclude unnecessary fields with transient, take full control via Externalizable, apply stream compression ( GZIPOutputStream, ZipOutputStream), accelerate I/O with buffering ( BufferedOutputStream, BufferedInputStream) and fast copying via FileChannel. transferTo. To assess performance, use both quick measurements with System. nanoTime(), and reliable microbenchmarks on JMH. We’ll finish with a mini experiment and a review of 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