有时候我们输入的input的内容需要判断一下是否是数字,所以为了更好的客户体验,在前端先处理一下: <input type="text" name="val" class="val" /> var t = document.getElementsByClassName('val')[0]; t.onchange = function(){ var val = this.value; if(!isNumber(val)) alert('
关于使用处理流的优势,归纳起来就是两点:(1)对于开发人员来说,使用处理流进行输入/输出操作更简单:(2)使用处理流执行效率更高. 1.BufferedInputStream/BufferedOutputStream和BufferedReader/BufferedWriter Constructor Description BufferedInputStream(InputStream in) Creates a BufferedInputStream and saves its argume