Java.Serialization.What is “serialization”?

Serialization is the process of converting a Java object into a byte stream — so it can be:

  • Saved to a file
  • Sent over a network
  • Stored in a database
  • Transferred between JVMs

Later, you can deserialize that byte stream back into the original object, preserving its state.

Continue reading →
Posted in Без рубрики | Comments Off on Java.Serialization.What is “serialization”?

Java.Streams.Why do we need symbolic links ?

🧠 Why You Might Want a Symbolic Link

🔁 1. Reference a file from multiple places

Let’s say you have:

/home/stanley/projects/common/config.json

And you’re working in multiple projects that all need this config:

/home/stanley/projects/projectA
/home/stanley/projects/projectB

Rather than copy config.json into each project (and update it in three places), you just do:

ln -s ../common/config.json config.json

Now your projects reference the same file, and updating one updates all.

Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.Why do we need symbolic links ?

Java.Streams.What is a “symbolic link”?

A symbolic link is a special file that points to another file or directory. Think of it like a shortcut or alias.

  • It doesn’t hold the actual data
  • It just contains a reference (a path) to the real file or folder
Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.What is a “symbolic link”?

Java.Streams.What is an “absolute path” and a “relative path”?

📘 What is a Path?

A path is simply the location of a file or directory in the file system.

Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.What is an “absolute path” and a “relative path”?

Java.Streams.Separators

Great one, Stanley! The path separator character in the file system depends on the operating system — and Java provides a portable way to handle this.

Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.Separators

Java.Streams.Is it possible to redirect standard input/output streams?

Java allows you to redirect standard input, output, and error streams quite easily using the System class. It’s super useful for logging, testing, piping data between tools, and even simulating a console in GUI apps.

Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.Is it possible to redirect standard input/output streams?

Java.Streams.Which classes support reading and writing streams in compressed format?

Great one, Stanley! 😎 In Java, working with compressed streams (like ZIP or GZIP) is well-supported — especially for reading/writing data on-the-fly in a compressed format.

Here are the key classes you’ll want to know:

Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.Which classes support reading and writing streams in compressed format?

Java.Streams.What file access modes does RandomAccessFile have?

📜 File Access Modes in RandomAccessFile

1. "r" — Read-only

  • Read operations only.
  • No writing allowed.
  • File must exist, or you’ll get FileNotFoundException.

🔹 Use Case: Inspect a file without modifying it.

RandomAccessFile raf = new RandomAccessFile("input.txt", "r");
Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.What file access modes does RandomAccessFile have?

Java.Streams.What do you know about RandomAccessFile?

📘 What is RandomAccessFile?

  • It’s part of java.io.
  • Supports both reading and writing.
  • Allows you to move the file pointer to read/write anywhere (random access).
  • Acts like a combination of DataInputStream + DataOutputStream + file pointer control.
Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.What do you know about RandomAccessFile?

Java.Streams.How to select all elements of a certain directory by criterion (for example, with a certain extension)?

To select all files in a specific directory that match a certain criterion — like a file extension — you can use either:

  • FileFilter or FilenameFilter (from java.io)
  • Java 8 Stream API
  • Java NIO DirectoryStream (from java.nio.file)
Continue reading →
Posted in Без рубрики | Comments Off on Java.Streams.How to select all elements of a certain directory by criterion (for example, with a certain extension)?