Home » Tag Archives: NIO

Tag Archives: NIO

JavaSE: How to SET/GET your own Files and Directory Attributes

java-logo

In the previous article “Determining Views Supported by a Particular File System” and see how to ask the file system store, and see supportability of a particular file attribute view. We are going to explore in a nutshell, one of the most advanced and important files attribute views which is User-Defined File Attributes View. Particularly, I am using this feature ...

Read More »

Ensuring the order of execution for tasks

java-logo

Sometimes it is necessary to impose certain order on the tasks in a threadpool. Issue 206 of the JavaSpecialists newsletter presents one such case: we have multiple connections from which we read using NIO. We need to ensure that events from a given connection are executed in-order but events between different connections can be freely mixed.         ...

Read More »

The Java ByteBuffer – a crash course

java-logo

In my experience, java.nio.ByteBuffer is a source of confusion and subtle bugs when developers first encounter it, because it is not immediately obvious how to use it correctly. It took some repeated reading of the API docs and some experience to realize some subtleties, before I felt comfortable with them. This post is a short crash in how to use ...

Read More »

Java 7: File Filtering using NIO.2 – Part 3

java-logo

Hello all. This is Part 3 of the File Filtering using NIO.2 series. For those of you who haven’t read Part 1 or Part 2, here’s a recap. NIO.2 is a new API for I/O operations included in the JDK since Java 7. With this new API, you can perform the same operations performed with java.io plus a lot of great functionalities such ...

Read More »

Java 7: File Filtering using NIO.2 – Part 2

java-logo

Hello all. This is Part 2 of the File Filtering using NIO.2 series. For those of you who haven’t read Part 1, here’s a recap. NIO.2 is a new API for I/O operations included in the JDK since Java 7. With this new API, you can perform the same operations performed with java.io plus a lot of great functionalities such as: Accessing ...

Read More »

Java 7: File Filtering using NIO.2 – Part 1

java-logo

NIO.2 is a new API for I/O operations included in the JDK since Java 7. With this new API, you can perform the same operations performed with java.io plus a lot of great functionalities such as: Accessing file metadata and watching for directory changes, among others. Obviously, the java.io package is not going to disappear because of backward compatibility, but ...

Read More »

I/O Demystified

java-logo

With all the hype on highly scalable server design and the rage behind nodejs I have been meaning to do some focused reading on IO design patterns to which until now couldn’t find enough time to invest. Now having done some research I thought it’s best to jot down stuff I came across as a future reference for me and any one ...

Read More »

IO vs. NIO – Interruptions, Timeouts and Buffers

java-logo

Let’s imagine a system that sometimes needs to copy a file to a few locations, but in a way where responsiveness is critical. In other words, if for some reason a file system is overloaded and we are unable to write our file in less than a second, it should give up. ExecutorService is a very convenient tool for the ...

Read More »

Java Sequential IO Performance

java-logo

Many applications record a series of events to file-based storage for later use. This can be anything from logging and auditing, through to keeping a transaction redo log in an event sourced design or its close relative CQRS. Java has a number of means by which a file can be sequentially written to, or read back again. This article explores ...

Read More »

Java 7: Closing NIO.2 file channels without loosing data

java-logo

Closing an asynchronous file channel can be very difficult. If you submitted I/O tasks to the asynchronous channel you want to be sure that the tasks are executed properly. This can actually be a tricky requirement on asynchronous channels for several reasons. The default channel group uses deamon threads as worker threads, which isn’t a good choice, cause these threads ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close