diff src/MyRfbProto.java @ 15:89e1c5f84407

faile ZRLE encode. success raw encode.
author e085711
date Sun, 17 Apr 2011 19:33:01 +0900
parents a5d73cafc8fe
children 4eda2dbb7fef
line wrap: on
line diff
--- a/src/MyRfbProto.java	Sun Apr 17 02:16:52 2011 +0900
+++ b/src/MyRfbProto.java	Sun Apr 17 19:33:01 2011 +0900
@@ -1,9 +1,8 @@
-import java.io.BufferedInputStream;
-import java.io.DataInputStream;
+import java.io.BufferedReader;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.net.ServerSocket;
 import java.net.Socket;
-import java.nio.ByteBuffer;
 import java.util.LinkedList;
 
 
@@ -12,8 +11,6 @@
 	private ServerSocket servSock; 	
 	private byte initData[];
 	private LinkedList <Socket> cliList;
-	boolean MYVNC = true;
-	
 	
 	MyRfbProto(String h, int p, VncViewer v ) throws IOException {
 		super(h, p, v);
@@ -44,10 +41,12 @@
 	
 	void mark(int len) throws IOException {
 		is.mark(len);
+		System.out.println("is.mark");
 	}
 
 	void reset() throws IOException {
 		is.reset();
+		System.out.println("is.reset");
 	}
 
 	boolean markSupported() {
@@ -108,9 +107,31 @@
 		for(Socket cli : cliList)
 			cli.getOutputStream().write(b, 0, b.length);		
 	}	
+	boolean ready() throws IOException {
+		BufferedReader br = new BufferedReader(new InputStreamReader(is));
+		return br.ready();
+	}	
 
 	int cliSize(){
 		return cliList.size();
 	}	
+	void printNumBytesRead(){
+		System.out.println("numBytesRead="+numBytesRead);
+	}	
+	void bufResetSend(int size) throws IOException {
+		reset();
+		int len = size;
+		if(available() < size )
+			len = available();
+		System.out.println("len="+len);
+		byte buffer[] = new byte[len];
+		readFully(buffer);
+		sendData(buffer);
+	}
+	void resetNumBytesRead(){
+		numBytesRead = 0;
+	}
+
+	
 	
 }