
Java
工匠解码
庖丁解牛,工匠解码
展开
-
使用ZipEntry进行图片压缩下载,文件夹中文乱码问题
public class ZipMainTest { public static void main(String[] args) { try { test1(); } catch (IOException e) { e.printStackTrace(); } } public static void test1() throws IOException {原创 2013-08-30 18:45:45 · 2163 阅读 · 0 评论 -
Arrays.asList返回结果执行clear方法抛java.lang.UnsupportedOperationException
代码public class ErrorTest { public static void main(String[] args) { String[] strArr=new String[]{"1","2","3"}; List<String> list=Arrays.asList(strArr); list.clear();原创 2017-03-01 11:27:49 · 1000 阅读 · 0 评论 -
深入Spring Cloud源码设计-基础篇
Spring Cloud是什么? “Spring Cloud provides tools for developers to quickly build some of the common patterns in distributed systems.” Spring Cloud为开发者提供了一套可以用来快速搭建分布式系统中常见模式的工具。提取主干即是Spring Cloud提供了一套工具原创 2017-07-12 20:34:27 · 3528 阅读 · 0 评论 -
线程状态
通常可以将线程状态归结为5种: 1. New:new Thread()或者new Runnable() 2. Runnable:调用start方法后 3. Running:运行中,获取必要资源包含CPU资源 4. 阻塞:sleep,wait,suspend 5. 消亡:线程执行结束,程序抛异常简化版图示: 精致版图示: 细化版图片: 阻塞状态细聊: 所谓阻塞状态是正在运行的线程没原创 2017-08-10 17:57:40 · 206 阅读 · 0 评论 -
java的classloader类加载器
Bootstrap类加载器: 加载JRE/lib/rt.jar Extension类加载器: 加载JRE/lib/ext或java.ext.dirs目录 Application类加载器:加载CLASSPATH环境变量,类加载器工作原则:双亲委派假设你有一个应用需要的类叫作Test.class,首先加载这个类的请求由Application类加载器委托给它的父类加载器Extension类加载器,然后转载 2017-08-10 18:04:55 · 335 阅读 · 0 评论 -
高并发场景的技术手段术语(开篇)
高并发指的是某个瞬间涌入海量请求,比如促销活动中的秒杀,抢券,抢红包等等。由于服务器端口是有上限,web服务器连接数有上限,数据库连接有上限,JVM内存有上限,CPU个数有上限,等等这一系列的限制,导致在这样的一个瞬间,系统是无法迅速对海量请求中每一个均做出逻辑处理响应,为了解决系统被打垮,并且尽量给每个请求一个合理的处理反馈,技术开发人员们摸索出了很多种应对的手段。前台动静分离 静态化 压缩(原创 2017-09-06 17:30:52 · 1141 阅读 · 0 评论 -
Callable返回的Future对象
Callable 返回Future对象,Future对象的get方法会阻塞,直到callable方法执行结束并且返回结果原创 2017-11-09 17:30:57 · 1013 阅读 · 0 评论 -
Access restriction: The type XX is not API (restriction on required library 'XXX/Ja
Access restriction: The type 'XMLChar' is not API (restriction on required library '/Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home/jre/lib/rt.jar')有时候,我们会引入rt.jar中的类来使用,比如: com.sun.or原创 2017-11-26 08:28:14 · 1862 阅读 · 0 评论