自定义装饰类
来源:互联网 发布:辐射4 mac 下载 编辑:程序博客网 时间:2024/06/05 17:24
import java.io.*;class MyBufferedReader extends Reader { private Reader r; MyBufferedReader(Reader r) { this.r = r; } public String myReadLine() throws IOException { StringBuilder sb = new StringBuilder(); int ch = 0; while ((ch = r.read()) != -1) { if (ch == '\r') continue; if (ch == '\n') return sb.toString(); else sb.append((char) ch); } if (sb.length() != 0) return sb.toString(); return null; } public void myClose() throws IOException { r.close(); } /* * 覆盖Reader类中的抽象方法。 */ public int read(char[] cbuf, int off, int len) throws IOException { return r.read(cbuf, off, len); } public void close() throws IOException { r.close(); }}
0 0
- 自定义装饰类BufferedReader
- 自定义装饰类
- IO流——自定义装饰类
- Django自定义装饰器
- Python-自定义装饰器
- java基础--IO流之装饰类与自定义装饰类
- 《黑马程序员》 装饰类-自定义BufferedReader和LineNumberReader
- JAVA之IO技术自定义装饰类MybufferedReader
- python django 自定义 装饰器
- 装饰设计模式---自定义数据源
- django 自定义一个 装饰器
- python装饰器装饰类
- J2SE中 装饰设计模式之用自定义类去实现BufferedReader类的功能
- WPF自定义控件 — 装饰器
- Django自定义用于Views的装饰器
- JAVA 装饰类(装饰设计模式)
- 装饰类及装饰设计模式
- 装饰者模式-装饰java.io类
- Moravec算子
- 【Android入门】Actionbar不显示overflow(右边三个小点)
- MySQL存储过程详解 mysql 存储过程
- Window Routing and Remote Access 服务(RRAS)无法启动
- 控件中显示系统当前时间?包括:年、月、日、时、分
- 自定义装饰类
- alt和title的区别和写法
- 7th_drv.c
- NSDate 的一些操作(比较、创建、在现有date加减一定时间等)
- LeetCode(90) Subsets II
- Android Please ensure that adb is correctly located at问题解决
- 使用Cookie记住表单用户名
- 实用的AndroidStudio快捷键
- hdu 5460 Poker(暴力)