04 2014 档案

摘要:"equals(Object obj)" and "hashCode()" should be overridden in pairsAccording to the Java Language Specification, there is a contract between equals(Ob... 阅读全文
posted @ 2014-04-22 14:17 D.Wang 阅读(2054) 评论(0) 推荐(0)
摘要:Thread.run() and Runnable.run() should not be called directly multithreadingThe purpose of the Thread.run() and Runnable.run() methods is to execute c... 阅读全文
posted @ 2014-04-22 11:54 D.Wang 阅读(239) 评论(0) 推荐(0)
摘要:缓冲区几个基本概念:position, 当前位置属性limit, 上界属性, put()/get() 时索引位置不允许超过上界值, put()超过上界则抛出BufferOverflowException(溢出), get() 超过上界则抛出BufferUnderflowException(暗流)capacity, 缓冲区总容量.mark, 保存的位置值, 通过mark() 设置, 设置之后可以通过reset()返回到这个位置mark = 0 || buf.position != 0) { buf.flip(); out.write(buf); buf.compact(); // I... 阅读全文
posted @ 2014-04-11 17:57 D.Wang 阅读(274) 评论(0) 推荐(0)