Mercurial > hg > Members > you > BroadCastTreeVNC
comparison src/treeVnc/RfbProto.java @ 5:970d5ac80256
add MyDataInputStream.java and DataInputStream1.java
author | one |
---|---|
date | Mon, 23 Apr 2012 21:10:23 +0900 |
parents | 657c691c2936 |
children |
comparison
equal
deleted
inserted
replaced
4:657c691c2936 | 5:970d5ac80256 |
---|---|
135 | 135 |
136 // Input stream is declared private to make sure it can be accessed | 136 // Input stream is declared private to make sure it can be accessed |
137 // only via RfbProto methods. We have to do this because we want to | 137 // only via RfbProto methods. We have to do this because we want to |
138 // count how many bytes were read. | 138 // count how many bytes were read. |
139 // private DataInputStream is; | 139 // private DataInputStream is; |
140 protected DataInputStream is; | 140 protected MyDataInputStream is; |
141 // private long numBytesRead = 0; | 141 // private long numBytesRead = 0; |
142 protected long numBytesRead = 0; | 142 protected long numBytesRead = 0; |
143 | 143 |
144 public long getNumBytesRead() { | 144 public long getNumBytesRead() { |
145 return numBytesRead; | 145 return numBytesRead; |
214 } catch (Exception e) { | 214 } catch (Exception e) { |
215 e.printStackTrace(); | 215 e.printStackTrace(); |
216 throw new IOException(e.getMessage()); | 216 throw new IOException(e.getMessage()); |
217 } | 217 } |
218 } | 218 } |
219 is = new DataInputStream(new BufferedInputStream(sock.getInputStream(), | 219 is = new DataInputStream1(new BufferedInputStream(sock.getInputStream(), |
220 16384)); | 220 16384)); |
221 os = sock.getOutputStream(); | 221 os = sock.getOutputStream(); |
222 | 222 |
223 timing = false; | 223 timing = false; |
224 timeWaitedIn100us = 5; | 224 timeWaitedIn100us = 5; |
229 host = h; | 229 host = h; |
230 port = p; | 230 port = p; |
231 | 231 |
232 sock = newSocket(host, port); | 232 sock = newSocket(host, port); |
233 | 233 |
234 is = new DataInputStream(new BufferedInputStream(sock.getInputStream(), | 234 is = new DataInputStream1(new BufferedInputStream(sock.getInputStream(), |
235 16384)); | 235 16384)); |
236 os = sock.getOutputStream(); | 236 os = sock.getOutputStream(); |
237 | 237 |
238 timing = false; | 238 timing = false; |
239 timeWaitedIn100us = 5; | 239 timeWaitedIn100us = 5; |
284 | 284 |
285 public void changeRfbProto(String h, int port) throws IOException { | 285 public void changeRfbProto(String h, int port) throws IOException { |
286 host = h; | 286 host = h; |
287 sock = null; | 287 sock = null; |
288 sock = newSocket(host, port); | 288 sock = newSocket(host, port); |
289 is = new DataInputStream(new BufferedInputStream(sock.getInputStream(), | 289 is = new DataInputStream1(new BufferedInputStream(sock.getInputStream(), |
290 16384)); | 290 16384)); |
291 os = sock.getOutputStream(); | 291 os = sock.getOutputStream(); |
292 | 292 |
293 timing = false; | 293 timing = false; |
294 timeWaitedIn100us = 5; | 294 timeWaitedIn100us = 5; |