-
URLConnection

Get response headers from HTTP request
With this example we are going to demonstrate how to get response headers from an HTTP request in Java. In…
Read More » -
URLConnection

Get cookies from HTTP connection
With this example we are going to demonstrate how to get cookies from an HTTP connection in Java. In short,…
Read More » -
CharBuffer

Convert String to byte array UTF encoding
With this example we are going to demonstrate how to convert a String to byte array and vice-versa using the…
Read More » -
FileChannel

Write to Channel with ByteBuffer
With this example we are going to demonstrate how to write data to a NIO Channel using a ByteBuffer in…
Read More » -
FileChannel

Save changes to memory mapped ByteBuffer from FileChannel
In this example we shall show you how to write data to a file using a memory mapped ByteBuffer and…
Read More » -
FileChannel

Copying binary file with FileChannel
With this example we demonstrate how to copy files using FileChannels in Java. In particular we are going to read…
Read More » -
FileLock

Create file lock on file
This is an example of how to create a file lock in Java. Creating file locks using Java NIO Channels…
Read More » -
ByteBuffer

Use ByteBuffer for non-byte Java types buffering
In this example we will demonstrate how to perform non-byte Java types buffering using a ByteBuffer in Java. In particular…
Read More » -
ByteBuffer

Get byte from ByteBuffer
With this example we are going to demonstrate how to read bytes from a ByteBuffer. Additionally we will show you…
Read More » -
ByteBuffer

Create direct and non-direct ByteBuffer
In this example we are going to demonstrate several methods of creating a direct (memory-mapped) and non-direct ByteBuffer in Java.…
Read More »
