pipedreader

PipedReader类ready()方法 (PipedReader Class ready() method)

  • ready() method is available in java.io package.

    ready()方法在java.io包中可用。

  • ready() method is used to check whether this PipedReader stream is ready to be read or not.

    ready()方法用于检查此PipedReader流是否已准备好被读取。

  • ready() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.

    ready()方法是一种非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。

  • ready() method may throw an exception at the time of checking the state of the stream.

    在检查流的状态时, ready()方法可能会引发异常。

    IOException: This exception may throw when getting any input/output error.

    IOException :遇到任何输入/输出错误时,可能引发此异常。

Syntax:

句法:

    public boolean ready();

Parameter(s):

参数:

  • It does not accept any parameter.

    它不接受任何参数。

Return value:

返回值:

The return type of the method is boolean, it returns true when this stream is ready to read (i.e. when input is available for next read() without blocking) otherwise it returns false.

该方法的返回类型为boolean ,当此流准备好读取时(即,当输入可用于下一个read()而不阻塞时)返回true,否则返回false。

Example:

例:

// Java program to demonstrate the example
// of boolean ready() method of PipedReader
import java.io.*;
public class ReadyOfPR {public static void main(String[] args) throws Exception {try {// Instantiates PipedReader and PipedWriter
PipedWriter pipe_w = new PipedWriter();
PipedReader pipe_r = new PipedReader();
pipe_r.connect(pipe_w);
// By using ready() method is to check whether
// this stream pipe_r is ready to be read or not
boolean status = pipe_r.ready();
System.out.println("pipe_r.ready(): " + status);
// By using close() method is to close
// the stream
pipe_w.close();
pipe_w.close();
} catch (Exception ex) {System.out.println(ex.toString());
}
}
}

Output

输出量

pipe_r.ready(): false

翻译自: https://www.includehelp.com/java/pipedreader-ready-method-with-example.aspx

pipedreader

pipedreader_Java PipedReader ready()方法与示例相关推荐

  1. Java PushbackReader ready()方法与示例

    PushbackReader类ready()方法 (PushbackReader Class ready() method) ready() method is available in java.i ...

  2. java reader_Java Reader ready()方法与示例

    java reader Reader类ready()方法 (Reader Class ready() method) ready() method is available in java.io pa ...

  3. python3 console input_Python console.colorize方法代码示例

    本文整理汇总了Python中pygments.console.colorize方法的典型用法代码示例.如果您正苦于以下问题:Python console.colorize方法的具体用法?Python ...

  4. java ready()_Java.io.BufferedReader.ready()方法实例

    全屏 java.io.BufferedReader.ready()方法通知流是否已准备好被读取.一个缓冲字符流是只准备当缓冲区不为空,或者底层流已准备就绪. 声明 以下是java.io.Buffere ...

  5. python cpu count_Python multiprocessing.cpu_count方法代码示例

    本文整理汇总了Python中multiprocessing.cpu_count方法的典型用法代码示例.如果您正苦于以下问题:Python multiprocessing.cpu_count方法的具体用 ...

  6. python中stringvar的用法_Python tkinter.StringVar方法代码示例

    本文整理汇总了Python中tkinter.StringVar方法的典型用法代码示例.如果您正苦于以下问题:Python tkinter.StringVar方法的具体用法?Python tkinter ...

  7. python中close_Python pool.close方法代码示例

    本文整理汇总了Python中multiprocessing.pool.close方法的典型用法代码示例.如果您正苦于以下问题:Python pool.close方法的具体用法?Python pool. ...

  8. python里config_Python config.get_config方法代码示例

    本文整理汇总了Python中config.get_config方法的典型用法代码示例.如果您正苦于以下问题:Python config.get_config方法的具体用法?Python config. ...

  9. drawimage的用法 java_Java Graphics.drawImage方法代码示例

    本文整理汇总了Java中javax.microedition.lcdui.Graphics.drawImage方法的典型用法代码示例.如果您正苦于以下问题:Java Graphics.drawImag ...

最新文章

  1. 学习ui设计的流程是什么
  2. 哥调的不是车,是寂寞
  3. const在指针中的用法
  4. initialProps被React-Navigation的navigation属性覆盖解决方案
  5. MyEclipse创建JavaWeb应用和TomCat的配置
  6. 【STM32】FreeRTOS任务挂起和恢复API
  7. P102、面试题14:调整数组顺序使奇数位于偶数前面
  8. angularjs1.x版本,父子组件之间的双向绑定
  9. [转]文件的操作方式
  10. 火速收藏!Android 开发者必会的内存泄漏指南
  11. mysql econnreset_javascript - 节点Js mysql(和mysql2)ECONNRESET - 堆栈内存溢出
  12. vimnbsp;自动识别UTF8和GB2312
  13. Android 跳转权限设置界面的终极方案
  14. 一些常用的google scholar网站
  15. 【海量地图图源合集】教你如何一键获取150+高清卫星影像、电子地图、地质图、DEM等地图图源
  16. 如何将已有图片做成透明水印_手把手教你如何使用Photoshop CC 2014给图片添加透明水印的教程-网络教程与技术 -亦是美网络...
  17. 吃糖果 (HDU-1205)(鸽笼原理(抽屉原理))
  18. Tapestry学习4
  19. mysql数据库读取数据,教你如何从 MySQL 数据库读取数据
  20. 计算机类专科学校排名,2017计算机专科学校排名一览表

热门文章

  1. wind试用版 matlab,免费产品试用 - MATLAB Simulink
  2. uint8 转换为 float
  3. JAVA知识基础(四):深入理解static关键字
  4. 递归基础之N皇后问题
  5. POJ3984 迷宫问题【BFS】
  6. 地铁售票系统设计思想及部分代码
  7. Sql Server 2016数据库生成带数据的脚本
  8. oracle 10g学习之分组函数
  9. Cell.reuseIdentifier 指什么
  10. 【正式发布】火星人敏捷开发手册2012-12-25(基于Scrum的敏捷开发免费培训教材及公司内部宣传材料)...