java
程序猿S先森丶
这个作者很懒,什么都没留下…
展开
-
利用BigInteger的setBit、testBit实现权限控制
setBit /** * Returns a BigInteger whose value is equivalent to this BigInteger * with the designated bit set. (Computes {@code (this | (1<<n))}.) * * @param n index of bit to set. * @return {@code this | (1<<n)}原创 2022-03-14 15:10:24 · 225 阅读 · 0 评论 -
同步与异步,阻塞与非阻塞
同步阻塞(Blocking IO) 客户端发送请求给服务端,此时服务端处理任务时间很久,则客户端则被服务端堵塞了,所以客户端会一直等待服务端的响应,此时客户端不能做事,服务端也不会接受其他客户端的请求。这种通信机制比较简单粗暴,但是效率不高。 同步非阻塞(Non-blocking IO) 客户端发送请求给服务端,此时服务端处理任务时间很久,这个时候虽然客户端会一直等待响应,但是服务端可以处理其他的请求,过一会回来的。这种方式很高效,一个服务端可以处理很多请求,不会在因为任务没有处理完而堵着,所以这是非阻塞的原创 2021-01-16 16:00:39 · 70 阅读 · 2 评论 -
java读取EXCEL
File file = new File("D:/readExcel.xls"); Workbook wb = null; if(file ==null){ return null; } String extString = filePath.substring(file.lastIndexOf(".")); InputStream is = null; try { ...原创 2020-08-11 20:06:15 · 137 阅读 · 0 评论