-
ServerSocket
Create Server Socket
This is an example of how to create a ServerSocket. A server socket waits for requests to come in over…
Read More » -
Socket
Read text from Socket
With this example we are going to demonstrate how to read text from a Socket. A Socket is an endpoint…
Read More » -
Socket
Create client Socket with timeout
In this example we shall show you how to create a client Socket with timeout. A client socket is an…
Read More » -
InetAddress
Get hostname from IP address
This is an example of how to get the host name of a remote host from its IP address. Doing…
Read More » -
InetAddress
Get IP address from hostname
In this example we shall show you how to retrieve the IP address from the hostname of a specific host.…
Read More » -
DatagramPacket
Receive network DatagramPacket
In this example we shall show you how to receive a Datagram packet in Java. For a host to receive…
Read More » -
URLConnection
Send cookie with HTTP request
This is an example of how to send a cookie with an HTTP request in Java. In short, to send…
Read More » -
CharBuffer
Convert Between Character Set Encodings with CharBuffer
In this example we shall show you how to convert between character set encodings with a CharBuffer in Java. To…
Read More » -
FileChannel
Create Stream from FileChannel
This is an example of how to create input and output streams to read and write data from/to a file…
Read More » -
FileChannel
Read from Channel with ByteBuffer
This is an example of how to read data from a NIO Channel using a ByteBuffer in Java. In particular…
Read More »