MCPcopy Create free account
hub / github.com/BombusMod/BombusMod / readLine

Method readLine

src/main/java/io/HttpProxyConnection.java:64–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62 }
63
64 public String readLine() throws IOException {
65 StringBuffer buf=new StringBuffer();
66
67 boolean eol=false;
68 while (true) {
69
70 while (is.available()==0)
71 try { Thread.sleep(100); } catch (Exception e) { }
72
73 int c = is.read();
74 if (c<0) {
75 eol=true;
76 if (buf.length()==0) return null;
77 break;
78 }
79 if (c==0x0d || c==0x0a) {
80 eol=true;
81 //inputstream.mark(2);
82 if (c==0x0a) break;
83 }
84 else {
85 if (eol) {
86 //afterEol=c;
87 //inputstream.reset();
88 break;
89 }
90 buf.append((char) c);
91 }
92 }
93 return buf.toString();
94 }
95
96
97 public InputStream openInputStream() throws IOException { return is; }

Callers 1

openMethod · 0.95

Calls 3

appendMethod · 0.80
readMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected