Netty series: detailed explanation of NIO and netty

brief introduction Why is netty fast? This is because the bottom layer of netty uses JAVA nio technology and optimizes the performance on its basis. Although netty is not a pure JAVA nio, the bottom layer of netty is still based on NiO technology. nio is jdk1 4, which is different from traditional IO, so nio can also be called new io. The thre ...

Posted by onthespot on Wed, 09 Mar 2022 12:05:19 +0100

Netty series: detailed explanation of NIO and netty

brief introduction Why is netty fast? This is because the bottom layer of netty uses JAVA nio technology and optimizes the performance on its basis. Although netty is not a pure JAVA nio, the bottom layer of netty is still based on NiO technology. nio is jdk1 4, which is different from traditional IO, so nio can also be called new io. Th ...

Posted by starnol on Wed, 09 Mar 2022 11:58:58 +0100

Java compression can be so optimized! The news is so exhilarating that everyone is celebrating and spreading it to the rest of the world

background Recently, the function of data export is being done. Since batch export is supported and the exported files are up to 3GB, it is decided to compress when exporting the final results first day java compression, emmm The first thought is java util. Zip the following APIs, directly to the code: /** * Batch compressed file v1 0 * ...

Posted by baitubai on Tue, 08 Mar 2022 15:19:29 +0100

Detailed explanation and application of NIO

1, Detailed explanation of foundation 1. Traditional IO(BIO) Traditional IO is stream oriented and synchronous blocking io. Each socket request needs to be processed by a corresponding thread. If there are not enough threads to process, the request is either waiting or rejected. That is, each connection requires the service to be processed by ...

Posted by TheMagician on Tue, 01 Mar 2022 13:31:14 +0100

[Socket and IO framework learning] 3 NiO (non blocking IO) Basics

[Socket and IO framework learning] 3 NiO (non blocking IO) Basics I haven't seen this thing for nearly half a month, and I have nothing to do today. I continue to record the learning NIO. This N represents "new". According to my Baidu, NIO was introduced in the version of jdk 1.4 to make up for the shortcomings of the original I/O ...

Posted by burfo on Thu, 03 Feb 2022 21:12:06 +0100

Summary of nio error prone knowledge points and code practice

Summary of error prone knowledge points NIO operates based on channel and buffer. Data is always read from the channel to the buffer or written from the buffer to the channel. The selector is used to listen to the events of multiple channels (such as connection request, data arrival, etc.), so a single thread can listen to multiple client cha ...

Posted by mattdarnold on Mon, 31 Jan 2022 22:04:21 +0100

Java advanced IO stream core module and basic principle

1, IO flow and system IO technology is an extremely complex module in JDK. One of the key reasons for its complexity is the correlation between IO operation and system kernel. In addition, network programming and file management all rely on Io technology, which is a programming difficulty. To understand IO flow as a whole, start with Linux ope ...

Posted by bailo81 on Mon, 17 Jan 2022 19:12:34 +0100

Basic knowledge of java (returning to nature) -- chapter2 (IO and NIO)

Traditional BIO mode For the traditional IO model, one Server interfaces with N clients. After the clients are connected, an execution thread is allocated to each client. characteristic: ① After each client connection arrives, a thread will be allocated to the client. It is used for reading and writing data, encoding and decoding and business c ...

Posted by mabus on Sun, 16 Jan 2022 07:00:57 +0100

Java basic syntax_ 24_ Network programming 02

1.NIO 1.1 NIO channel client [application] Client implementation steps Open channelSpecify the IP and port numberWrite dataRelease resources Sample code public class NIOClient { public static void main(String[] args) throws IOException { //1. Open the channel SocketChannel socketChannel = SocketChannel.open(); ...

Posted by uNF on Fri, 14 Jan 2022 22:20:30 +0100

Java interview questions - NIO related interview questions

1. Differences among NiO, BIO and AIO BIO: the traditional network communication model is BIO, synchronous blocking IO In fact, the server creates a ServerSocket, and then the client uses a Socket to connect to the ServerSocket of the server. When the ServerSocket receives a connection request, it creates a Socket and a thread to communicate ...

Posted by rocketsprocket on Fri, 14 Jan 2022 08:59:49 +0100