java.io.BufferedInputStream.read1()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(233)

本文整理了Java中java.io.BufferedInputStream.read1()方法的一些代码示例,展示了BufferedInputStream.read1()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BufferedInputStream.read1()方法的具体详情如下:
包路径:java.io.BufferedInputStream
类名称:BufferedInputStream
方法名:read1

BufferedInputStream.read1介绍

[英]Read characters into a portion of an array, reading from the underlying stream at most once if necessary.
[中]将字符读入数组的一部分,必要时最多从底层流中读取一次。

代码示例

代码示例来源:origin: stackoverflow.com

"main" #1 prio=5 os_prio=31 tid=0x00007fef4d803000 nid=0xf07 
 waiting for monitor entry [0x000000010b7a3000]
  java.lang.Thread.State: BLOCKED (on object monitor)
  at java.io.BufferedReader.close(BufferedReader.java:522)
  - waiting to lock <0x000000076ac47f78> (a java.io.InputStreamReader)
  at ReaderService.stop(ReaderService.java:19)
  at ReaderService.main(ReaderService.java:34)

"Thread-0" #10 prio=5 os_prio=31 tid=0x00007fef4c873800 nid=0x5503 runnable [0x000000012b497000]
  java.lang.Thread.State: RUNNABLE
  at java.io.FileInputStream.readBytes(Native Method)
  at java.io.FileInputStream.read(FileInputStream.java:255)
  at java.io.BufferedInputStream.read1(BufferedInputStream.java:284)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
  - locked <0x000000076ab1bf10> (a java.io.BufferedInputStream)
  at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
  at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
  at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
  - locked <0x000000076ac47f78> (a java.io.InputStreamReader)
  at java.io.InputStreamReader.read(InputStreamReader.java:184)
  at java.io.BufferedReader.fill(BufferedReader.java:161)
  at java.io.BufferedReader.readLine(BufferedReader.java:324)
  - locked <0x000000076ac47f78> (a java.io.InputStreamReader)
  at java.io.BufferedReader.readLine(BufferedReader.java:389)
  at ReaderService.start(ReaderService.java:10)
  at ReaderService$1.run(ReaderService.java:29)
  at java.lang.Thread.run(Thread.java:745)

代码示例来源:origin: stackoverflow.com

> jps
83518 Test

> jstack 83518
2015-12-24 21:25:17
Full thread dump Java HotSpot(TM) 64-Bit Server VM (24.65-b04 mixed mode):

...

"main" prio=5 tid=0x00007fbba2001000 nid=0x1903 runnable [0x000000010a560000]
  java.lang.Thread.State: RUNNABLE
  at java.io.FileInputStream.readBytes(Native Method)
  at java.io.FileInputStream.read(FileInputStream.java:272)
  at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
  at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
  - locked <0x00000007aaa9a5f0> (a java.io.BufferedInputStream)
  at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:283)
  at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:325)
  at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:177)
  - locked <0x00000007aab2ad88> (a java.io.InputStreamReader)
  at java.io.InputStreamReader.read(InputStreamReader.java:184)
  at java.io.BufferedReader.fill(BufferedReader.java:154)
  at java.io.BufferedReader.readLine(BufferedReader.java:317)
  - locked <0x00000007aab2ad88> (a java.io.InputStreamReader)
  at java.io.BufferedReader.readLine(BufferedReader.java:382)
  at Test.main(Test.java:22)

...

代码示例来源:origin: jtulach/bck2brwsr

int nread = read1(b, off + n, len - n);
if (nread <= 0)
  return (n == 0) ? nread : n;

代码示例来源:origin: org.apidesign.bck2brwsr/emul

int nread = read1(b, off + n, len - n);
if (nread <= 0)
  return (n == 0) ? nread : n;

代码示例来源:origin: stackoverflow.com

Exception in thread "main" java.net.SocketTimeoutException: Read timed out
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.read(SocketInputStream.java:129)
 at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
 at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
 at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
 at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:695)
 at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
 at test.Main.main(Main.java:25)

相关文章