ByteBuffer How to use flip() and compact() - Feature image

by Sven Woltmann – February 26, 2020

In this article, I show you, using an example, how the Java ByteBuffer works, and what precisely the Methoden flip() and compact() do. The article answers the following questions: What is a ByteBuffer, and what do you need it for? How do you create a ByteBuffer? What do the values position, limit, and capacity mean?

Read More »
FileChannel, ByteBuffer, Memory-mapped I/O, Locks - Feature image

by Sven Woltmann – February 26, 2020

The previous five parts of this article series covered reading and writing files, directory and file path construction, directory and file operations, and writing and reading structured data. In today’s part, I explain the NIO classes FileChannel and ByteBuffer introduced in Java 1.4 with JSR 51 (“New I/O APIs for the JavaTM Platform”). Moreover, I

Read More »