Netty4自学笔记 (2) - Java NIO
距离上一篇博文已经过去了半个多月。这期间有一周多的时间用在了准备单位举办的英语竞赛上。余下的时间沉迷于陪孩子玩耍和睡觉,日复一日。 当然,我也抽空学习了Java NIO(None-Blocking / New IO) 一些知识,现总结如下。 Java的非阻塞IO的原理是采用了操作系统的多路复用器机制,即在一个通道(channel)上,注册一个事件选择器(selector)及各种事件(读、...
距离上一篇博文已经过去了半个多月。这期间有一周多的时间用在了准备单位举办的英语竞赛上。余下的时间沉迷于陪孩子玩耍和睡觉,日复一日。 当然,我也抽空学习了Java NIO(None-Blocking / New IO) 一些知识,现总结如下。 Java的非阻塞IO的原理是采用了操作系统的多路复用器机制,即在一个通道(channel)上,注册一个事件选择器(selector)及各种事件(读、...
2012年,由于项目的需要我第一次接触到了Netty,当时Netty还处于3.x版本。我用十几篇博文记录了自己自学Netty的过程,虽然内容浅薄,但没想到被各处转载,我想主要是因为当时Netty的资料确实较少的缘故。 五六年过去了,Netty早已发展到了4.x系列,好奇也好,求知也罢,我打算重学Netty,虽然严格来说,我已不是IT从业人员,但我仍希望保留对技术的热爱与追求。 学习Net...
Problem Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front of queue. peek() -- Get the front el...
Problem Given an integer, write a function to determine if it is a power of two. Example 1: Input: 1 Output: true Explanation: 2^0 = 1 Example 2: Input: 16 Output: true Explanation: 2^4 = 16...
Problem Invert a binary tree. Example: Input: 4 / \ 2 7 / \ / \ 1 3 6 9 Output: 4 / \ 7 2 / \ / \ 9 6 3 1 对树进行完全的左右节点交换 Python3 # Invert a b...
Problem Implement the following operations of a stack using queues. push(x) – Push element x onto stack. pop() – Removes the element on top of the stack. top() – Get the top element. empty() – Re...
Problem Given an array of integers and an integer k, find out whether there are two distinct indices i and j in the array such that nums[i] = nums[j] and the absolute difference between i and j is...
Problem Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if eve...
Problem Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4->3->2->1->NULL Follow up: A linked list can be reversed either iteratively...
Problem Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrences of a character must be replaced w...