Author Archives: Stanislav_Panteleev

Java.Streams.What do you know about the FileFilter interface?

📘 What is FileFilter? It’s part of java.io. It’s a functional interface with one method: Used to filter files or directories based on your logic (e.g., extension, size, name pattern).

Posted in Без рубрики | Comments Off on Java.Streams.What do you know about the FileFilter interface?

Java.Streams.What methods of the File class do you know?

Here’s a categorized list of the most commonly used methods of the File class: 📁 File Creation & Deletion Method Description createNewFile() Creates a new empty file if it doesn’t exist delete() Deletes the file or directory deleteOnExit() Deletes file … Continue reading →

Posted in Без рубрики | Comments Off on Java.Streams.What methods of the File class do you know?

Java.Which class is designed to work with file system elements?

📁 java.io.File 🧠 What is File? It’s a class in the java.io package. It represents a file or directory path in an abstract, platform-independent way. It does not read/write file content itself — it provides metadata and file system operations.

Posted in Без рубрики | Comments Off on Java.Which class is designed to work with file system elements?

Java.Streams.Why not use BufferedReader / BufferedWriter always ?

in most real-world scenarios, buffering improves performance and is recommended: ✅ Reduces I/O system calls ✅ Speeds up character-by-character reading/writing ✅ Adds convenient methods: readLine(), newLine() That’s why BufferedReader and BufferedWriter are used in 90%+ of text-processing code.

Posted in Без рубрики | Comments Off on Java.Streams.Why not use BufferedReader / BufferedWriter always ?

Java.Streams.What classes allow you to speed up reading/writing by using a buffer?

🚀 Buffered I/O Classes in Java 🔹 1. BufferedInputStream Extends: FilterInputStream Buffers: Raw byte input Used with: InputStream

Posted in Без рубрики | Comments Off on Java.Streams.What classes allow you to speed up reading/writing by using a buffer?

Java.Streams.What classes allow you to convert byte streams to character streams and back?

🔁 Classes that Convert Between Byte and Character Streams 🔹 1. InputStreamReader Converts: InputStream → Reader Direction: Byte → Character Use case: Reading a byte stream (e.g., from a file or network) as text. ✅ Example: Wraps an InputStream Decodes … Continue reading →

Posted in Без рубрики | Comments Off on Java.Streams.What classes allow you to convert byte streams to character streams and back?

Java.Streams.

🔄 Commonalities Feature InputStream / OutputStream Reader / Writer Belong to java.io package java.io package Abstract classes Yes ✅ Yes ✅ Base for stream hierarchy Yes ✅ Yes ✅ Support chaining/wrapping Yes ✅ Yes ✅ (e.g., with buffering) Need to … Continue reading →

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

Java.Streams.What is the difference between the PrintWriter class and the PrintStream?

🆚 PrintWriter vs PrintStream Feature PrintWriter PrintStream Package java.io java.io Extends Writer (character-based) OutputStream (byte-based) Works with Character streams Byte streams Encoding-aware ✅ Yes (especially with OutputStreamWriter) ❌ No — uses platform default charset Methods print(), println(), printf(), write() print(), … Continue reading →

Posted in Без рубрики | Comments Off on Java.Streams.What is the difference between the PrintWriter class and the PrintStream?

Java.Streams.What subclasses of the Writer class do you know, what are they for?

📘 Writer Overview Writer is an abstract class in java.io for writing character data. It’s the counterpart to OutputStream, but designed for writing text (characters and strings) rather than raw bytes.

Posted in Без рубрики | Comments Off on Java.Streams.What subclasses of the Writer class do you know, what are they for?

Java.Streams.What subclasses of the Reader class do you know, what are they for?

The Reader class is part of Java’s character-based I/O system, introduced to handle text data (as opposed to InputStream which handles raw bytes). Let’s go over the key subclasses and their purposes.

Posted in Без рубрики | Comments Off on Java.Streams.What subclasses of the Reader class do you know, what are they for?