comparison src/treeVnc/RfbProto.java @ 2:5d72f4c7371d

befor change
author Yu Taninari <you@cr.ie.u-ryukyu.ac.jp>
date Sat, 07 Apr 2012 14:55:34 +0900
parents 1d5cebe3bca0
children 3b341997141a
comparison
equal deleted inserted replaced
1:1d5cebe3bca0 2:5d72f4c7371d
26 // 26 //
27 27
28 import java.io.*; 28 import java.io.*;
29 import java.awt.event.*; 29 import java.awt.event.*;
30 import java.net.Socket; 30 import java.net.Socket;
31 import java.nio.ByteBuffer;
32 import java.util.LinkedList;
31 import java.util.zip.*; 33 import java.util.zip.*;
32 34
33 class RfbProto { 35 public class RfbProto {
34 36
35 final static String versionMsg_3_3 = "RFB 003.003\n", 37 final static String versionMsg_3_3 = "RFB 003.003\n",
36 versionMsg_3_7 = "RFB 003.007\n", versionMsg_3_8 = "RFB 003.008\n",versionMsg_3_855 = "RFB 003.855\n"; 38 versionMsg_3_7 = "RFB 003.007\n", versionMsg_3_8 = "RFB 003.008\n",versionMsg_3_855 = "RFB 003.855\n";
37 39
38 40
1366 1368
1367 public void readFully(byte b[]) throws IOException { 1369 public void readFully(byte b[]) throws IOException {
1368 readFully(b, 0, b.length); 1370 readFully(b, 0, b.length);
1369 } 1371 }
1370 1372
1371 long before = System.currentTimeMillis(); 1373 long before = System.currentTimeMillis();
1372 public void readFully(byte b[], int off, int len) throws IOException { 1374 public void readFully(byte b[], int off, int len) throws IOException {
1373 long before = 0; 1375 // long before = 0;
1374 if (timing) 1376 if (timing)
1375 before = System.currentTimeMillis(); 1377 before = System.currentTimeMillis();
1376 1378
1377 is.readFully(b, off, len); 1379 is.readFully(b, off, len);
1378 1380
1381 /*
1382 if(b.length==16) {
1383 b[4] = (byte)0;
1384 b[5] = (byte)0;
1385 b[6] = (byte)0;
1386 b[7] = (byte)0;
1387 System.out.println("----------------------");
1388 }
1389 */
1390 //System.out.println("Blength:"+b.length);
1391 //for(int i=0 ; i<=b.length ; i++) {
1392 //if(i>b.length/2)
1393 //b[i] = 10;
1394 //}
1395
1396 /*
1379 if (timing) { 1397 if (timing) {
1380 long after = System.currentTimeMillis(); 1398 long after = System.currentTimeMillis();
1381 long newTimeWaited = (after - before) * 10; 1399 long newTimeWaited = (after - before) * 10;
1382 int newKbits = len * 8 / 1000; 1400 int newKbits = len * 8 / 1000;
1383 1401
1390 1408
1391 timeWaitedIn100us += newTimeWaited; 1409 timeWaitedIn100us += newTimeWaited;
1392 timedKbits += newKbits; 1410 timedKbits += newKbits;
1393 before = after; 1411 before = after;
1394 } 1412 }
1395 1413 */
1396 numBytesRead += len; 1414 numBytesRead += len;
1415 //System.out.println("numBytesRead:"+numBytesRead);
1397 } 1416 }
1398 1417
1399 final int available() throws IOException { 1418 final int available() throws IOException {
1400 return is.available(); 1419 return is.available();
1401 } 1420 }
1424 final int readU32() throws IOException { 1443 final int readU32() throws IOException {
1425 int r = is.readInt(); 1444 int r = is.readInt();
1426 numBytesRead += 4; 1445 numBytesRead += 4;
1427 return r; 1446 return r;
1428 } 1447 }
1448
1449 public LinkedList<ByteBuffer> blockingUpdateRectangle(ByteBuffer input,int w,int h) {
1450
1451 return null;
1452 }
1429 } 1453 }