亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? rfbproto.java

?? 一個遠程登陸器的原代碼
?? JAVA
?? 第 1 頁 / 共 4 頁
字號:
		updateRectH = is.readUnsignedShort();
		updateRectEncoding = is.readInt();

		if (updateRectEncoding == EncodingZlib
			|| updateRectEncoding == EncodingTight)
			wereZlibUpdates = true;

		// If the session is being recorded:
		if (rec != null) {
			if (numUpdatesInSession > 1)
				rec.flush(); // Flush the output on each rectangle.
			rec.writeShortBE(updateRectX);
			rec.writeShortBE(updateRectY);
			rec.writeShortBE(updateRectW);
			rec.writeShortBE(updateRectH);
			if (updateRectEncoding == EncodingZlib && !recordFromBeginning) {
				// Here we cannot write Zlib-encoded rectangles because the
				// decoder won't be able to reproduce zlib stream state.
				if (!zlibWarningShown) {
					System.out.println(
						"Warning: Raw encoding will be used "
							+ "instead of Zlib in recorded session.");
					zlibWarningShown = true;
				}
				rec.writeIntBE(EncodingRaw);
			} else {
				rec.writeIntBE(updateRectEncoding);
				if (updateRectEncoding == EncodingTight
					&& !recordFromBeginning
					&& !tightWarningShown) {
					System.out.println(
						"Warning: Re-compressing Tight-encoded "
							+ "updates for session recording.");
					tightWarningShown = true;
				}
			}
		}

		if (updateRectEncoding == EncodingLastRect
			|| updateRectEncoding == EncodingNewFBSize)
			return;

		if (updateRectX + updateRectW > framebufferWidth
			|| updateRectY + updateRectH > framebufferHeight) {
			throw new Exception(
				"Framebuffer update rectangle too large: "
					+ updateRectW
					+ "x"
					+ updateRectH
					+ " at ("
					+ updateRectX
					+ ","
					+ updateRectY
					+ ")");
		}
	}

	// Read CopyRect source X and Y.

	int copyRectSrcX, copyRectSrcY;

	void readCopyRect() throws IOException {
		copyRectSrcX = is.readUnsignedShort();
		copyRectSrcY = is.readUnsignedShort();

		// If the session is being recorded:
		if (rec != null) {
			rec.writeShortBE(copyRectSrcX);
			rec.writeShortBE(copyRectSrcY);
		}
	}

	//
	// Read a ServerCutText message
	//

	String readServerCutText() throws IOException {
		byte[] pad = new byte[3];
		is.readFully(pad);
		int len = is.readInt();
		byte[] text = new byte[len];
		is.readFully(text);
		return new String(text);
	}

	//
	// Read an integer in compact representation (1..3 bytes).
	// Such format is used as a part of the Tight encoding.
	// Also, this method records data if session recording is active and
	// the viewer's recordFromBeginning variable is set to true.
	//

	int readCompactLen() throws IOException {
		int[] portion = new int[3];
		portion[0] = is.readUnsignedByte();
		int byteCount = 1;
		int len = portion[0] & 0x7F;
		if ((portion[0] & 0x80) != 0) {
			portion[1] = is.readUnsignedByte();
			byteCount++;
			len |= (portion[1] & 0x7F) << 7;
			if ((portion[1] & 0x80) != 0) {
				portion[2] = is.readUnsignedByte();
				byteCount++;
				len |= (portion[2] & 0xFF) << 14;
			}
		}

		if (rec != null && recordFromBeginning)
			for (int i = 0; i < byteCount; i++)
				rec.writeByte(portion[i]);

		return len;
	}

	//Author: Kenn Min Chong/////////////////////////////////////////////

	//Read/Write a rfbFileTransferMsg
	/*typedef struct _rfbFileTransferMsg {
	    CARD8 type;			// always rfbFileTransfer
	    CARD8 contentType;  // See defines below
	    CARD16 contentParam;// Other possible content classification (Dir or File name, etc..)
		CARD32 size;		// FileSize or packet index or error or other 
	    CARD32 length;
	    // followed by data char text[length]
	} rfbFileTransferMsg;
	*/

	//	Parsing Rfb message to see what type 

	void readRfbFileTransferMsg() throws IOException
	{
		int contentType = is.readUnsignedByte();
		int contentParamT = is.readUnsignedByte();
		int contentParam = contentParamT;
		contentParamT = is.readUnsignedByte();
		contentParamT = contentParamT << 8;
		contentParam = contentParam | contentParamT;
		if (contentType == rfbRDrivesList || contentType == rfbDirPacket)
		{
			readDriveOrDirectory(contentParam);
		}
		else if (contentType == rfbFileHeader)
		{
			receiveFileHeader();
		}
		else if (contentType == rfbFilePacket)
		{
				receiveFileChunk();
		}
		else if (contentType == rfbEndOfFile)
		{
			endOfReceiveFile(true); // Ok
		}
		else if (contentType == rfbAbortFileTransfer)
		{
			if (fFileReceptionRunning)
			{
				endOfReceiveFile(false); // Error
			}
			else
			{
				// sf@2004 - Todo: Add TestPermission 
				// System.out.println("File Transfer Aborted!");
			}
			
		}
		else if (contentType == rfbCommandReturn)
		{
			createDirectoryorDeleteFile(contentParam);
		}
		else if (contentType == rfbFileAcceptHeader)
		{
			sendFile();
		}
		else if (contentType == rfbFileChecksums)
		{
			ReceiveDestinationFileChecksums();
		}
		else
		{
			System.out.println("ContentType: " + contentType);
		}
	}

	//Refactored from readRfbFileTransferMsg()
	public void createDirectoryorDeleteFile(int contentParam)
		throws IOException {
		if (contentParam == rfbADirCreate)
		{
			createRemoteDirectoryFeedback();
		}
		else if (contentParam == rfbAFileDelete)
		{
			deleteRemoteFileFeedback();
		}
	}

	//Refactored from readRfbFileTransferMsg()
	public void readDriveOrDirectory(int contentParam) throws IOException {
		if (contentParam == rfbADrivesList)
		{
			readFTPMsgDriveList();
		}
		else if (contentParam == rfbADirectory && !inDirectory2)
		{
			inDirectory2 = true;
			readFTPMsgDirectoryList();
		}
		else if (contentParam == rfbADirectory && inDirectory2)
		{
			readFTPMsgDirectoryListContent();
		}
		else if (contentParam == 0)
		{
			readFTPMsgDirectoryListEndContent();
			inDirectory2 = false;
		}
		else
		{
			System.out.println("ContentParam: " + contentParam);
		}
	}

	// Internally used. Write an Rfb message to the server
	void writeRfbFileTransferMsg(
								int contentType,
								int contentParam,
								long size, // 0 : compression not supported - 1 : compression supported
								long length,
								String text) throws IOException
	{
		byte b[] = new byte[12];

		b[0] = (byte) rfbFileTransfer;
		b[1] = (byte) contentType;
		b[2] = (byte) contentParam;

		byte by = 0;
		long c = 0;
		length++;
		c = size & 0xFF000000;
		by = (byte) (c >>> 24);
		b[4] = by;
		c = size & 0xFF0000;
		by = (byte) (c >>> 16);
		b[5] = by;
		c = size & 0xFF00;
		by = (byte) (c >>> 8);
		b[6] = by;
		c = size & 0xFF;
		by = (byte) c;
		b[7] = by;

		c = length & 0xFF000000;
		by = (byte) (c >>> 24);
		b[8] = by;
		c = length & 0xFF0000;
		by = (byte) (c >>> 16);
		b[9] = by;
		c = length & 0xFF00;
		by = (byte) (c >>> 8);
		b[10] = by;
		c = length & 0xFF;
		by = (byte) c;
		b[11] = by;
		os.write(b);
		

		if (text != null)
		{
			byte byteArray[] = text.getBytes();
			byte byteArray2[] = new byte[byteArray.length + 1];
			for (int i = 0; i < byteArray.length; i++) {
				byteArray2[i] = byteArray[i];
			}
			byteArray2[byteArray2.length - 1] = 0;
			os.write(byteArray2);
		}
		
	}

	//Internally used. Write an rfb message to the server for sending files ONLY 
	int writeRfbFileTransferMsgForSendFile(
											int contentType,
											int contentParam,
											long size,
											long length,
											String source
											) throws IOException
	{
		File f = new File(source);
		fis = new FileInputStream(f);
		byte byteBuffer[] = new byte[sz_rfbBlockSize]; 
		int bytesRead = fis.read(byteBuffer);
		long counter=0;
		boolean fError = false;
		
		// sf@ - Manage compression
		boolean fCompress = true;
		Deflater myDeflater = new Deflater();
		byte[] CompressionBuffer = new byte[sz_rfbBlockSize + 1024];
		int compressedSize = 0;
	
		while (bytesRead!=-1)
		{
				counter += bytesRead;
				myDeflater.setInput(byteBuffer, 0, bytesRead);
				myDeflater.finish();
				compressedSize = myDeflater.deflate(CompressionBuffer);
				myDeflater.reset();
				// If the compressed data is larger than the original one, we're dealing with
				// already compressed data
				if (compressedSize > bytesRead)
					fCompress = false;
				this.writeRfbFileTransferMsg(
											contentType,
											contentParam,
											(fCompress ? 1 : 0), 
											(fCompress ? compressedSize-1 : bytesRead-1),
											null
											);
				// Todo: Test write error !
				os.write(
						fCompress ? CompressionBuffer : byteBuffer,
						0,
						fCompress ? compressedSize : bytesRead
						);
				
				// Todo: test read error !
				bytesRead = fis.read(byteBuffer);
				
				// viewer.ftp.connectionStatus.setText("Sent: "+ counter + " bytes of "+ f.length() + " bytes");
				viewer.ftp.jProgressBar.setValue((int)((counter * 100) / f.length()));
				viewer.ftp.connectionStatus.setText(">>> Sending File: " + source + " - Size: " + f.length() + " bytes - Progress: " + ((counter * 100) / f.length()) + "%");
				
				if (fAbort == true)
				{
					fAbort = false;
					fError = true;
					break;
				}
				try
				{
			        Thread.sleep(5);
			    }
				catch(InterruptedException e)
				{
			        System.err.println("Interrupted");
			    }				
		}
		
		writeRfbFileTransferMsg(fError ? rfbAbortFileTransfer : rfbEndOfFile, 0, 0, 0, null);
		fis.close();
		return (fError ? -1 : 1);
	}

	//This method is internally used to send the file to the server once the server is ready
	void sendFile()
	{
		try
		{
			viewer.ftp.disableButtons();
			int size = is.readInt();
			int length = is.readInt();
			for (int i = 0; i < length; i++)
			{
				System.out.print((char) is.readUnsignedByte());
			}
			
			int ret = writeRfbFileTransferMsgForSendFile(
															rfbFilePacket,
															0,
															0,
															0,
															sendFileSource);
	
			viewer.ftp.refreshRemoteLocation();
			if (ret != 1)
			{
				viewer.ftp.connectionStatus.setText(" > Error - File NOT sent");
				viewer.ftp.historyComboBox.insertItemAt(new String(" > Error - File: <" + sendFileSource) + "> was not correctly sent (aborted by user or error)",0);
			}
			else
			{
				viewer.ftp.connectionStatus.setText(" > File sent");
				viewer.ftp.historyComboBox.insertItemAt(new String(" > File: <" + sendFileSource) + "> was sent to Remote Machine",0);
			}
			viewer.ftp.historyComboBox.setSelectedIndex(0);
			viewer.ftp.enableButtons();
		}
		catch (IOException e)
		{
			System.err.println(e);
		}
	}

	//Call this method to send a file from local pc to server
	void offerLocalFile(String source, String destinationPath)
	{
		try
		{
			sendFileSource = source;
			File f = new File(source);
			// sf@2004 - Add support for huge files
			long lSize = f.length();
			int iLowSize = (int)(lSize & 0x00000000FFFFFFFF); 
			int iHighSize = (int)(lSize >> 32);
			
			String temp = destinationPath + f.getName();
			writeRfbFileTransferMsg(
									rfbFileTransferOffer,
									0,
									iLowSize, // f.length(),
									temp.length(),
									temp);
			
			// sf@2004 - Send the high part of the size			
			byte b[] = new byte[4];
			byte by = 0;
			long c = 0;
			c = iHighSize & 0xFF000000;
			by = (byte) (c >>> 24);
			b[0] = by;
			c = iHighSize & 0xFF0000;
			by = (byte) (c >>> 16);
			b[1] = by;
			c = iHighSize & 0xFF00;
			by = (byte) (c >>> 8);
			b[2] = by;
			c = iHighSize & 0xFF;
			by = (byte) c;
			b[3] = by;			
			os.write(b); 
		}
		catch (IOException e)
		{
			System.err.println(e);
		}
	}

	//Internally used.
	//Handles acknowledgement that the file has been deleted on the server
	void deleteRemoteFileFeedback() throws IOException
	{
		is.readInt();
		int length = is.readInt();
		String f = "";
		for (int i = 0; i < length; i++)
		{
			f += (char)is.readUnsignedByte();
		}
		
		viewer.ftp.refreshRemoteLocation();	
		viewer.ftp.historyComboBox.insertItemAt(new String(" > Deleted File On Remote Machine: " + f.substring(0, f.length()-1)),0);
		viewer.ftp.historyComboBox.setSelectedIndex(0);
	}

	//Call this method to delete a file at server
	void deleteRemoteFile(String text)
	{
		try
		{
			String temp = text;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩在线精品一区二区三区激情 | 亚洲福利国产精品| 亚洲自拍偷拍欧美| 日本三级亚洲精品| 国产激情视频一区二区在线观看 | 欧美国产国产综合| 亚洲色图另类专区| 免费观看在线综合| 不卡欧美aaaaa| 欧美色区777第一页| 欧美精品一区二区在线观看| 国产精品乱码久久久久久| 亚洲第一狼人社区| 国产精品99久久久| 欧美日韩日日骚| 久久久久久久久久美女| 亚洲国产精品精华液网站| 国产成人精品一区二区三区网站观看| 91视频你懂的| 欧美精品一区男女天堂| 樱花影视一区二区| 国产在线精品一区二区| 欧洲av一区二区嗯嗯嗯啊| 久久奇米777| 亚洲尤物视频在线| 高清beeg欧美| 欧美一级久久久| 亚洲精品一卡二卡| 国产麻豆一精品一av一免费| 欧美性淫爽ww久久久久无| 久久久久国色av免费看影院| 亚洲成人1区2区| 成人免费高清视频| 日韩一区二区三| 亚洲精品国产第一综合99久久| 开心九九激情九九欧美日韩精美视频电影 | 欧美日韩国产综合视频在线观看| 国产欧美日韩在线观看| 日韩精品电影一区亚洲| 色激情天天射综合网| 国产午夜一区二区三区| 日本欧美肥老太交大片| 欧美亚洲一区三区| 亚洲图片欧美激情| 国产二区国产一区在线观看| 91精品国产黑色紧身裤美女| 亚洲美女免费视频| 成人深夜视频在线观看| 久久综合视频网| 美女精品一区二区| 51精品视频一区二区三区| 亚洲伊人伊色伊影伊综合网| eeuss鲁片一区二区三区在线观看| 久久综合视频网| 老鸭窝一区二区久久精品| 欧美丰满少妇xxxxx高潮对白| 一区二区高清视频在线观看| 91免费国产在线| 亚洲欧洲无码一区二区三区| 国产精品一色哟哟哟| 精品国产乱子伦一区| 五月天精品一区二区三区| 91久久国产最好的精华液| 国产精品国产三级国产a| 高清shemale亚洲人妖| 久久蜜臀中文字幕| 久久99精品久久久| 欧美电视剧免费观看| 午夜激情一区二区三区| 欧美性高清videossexo| 夜夜亚洲天天久久| 欧美亚洲日本一区| 亚洲成人av电影| 在线成人免费视频| 日韩成人午夜精品| 日韩欧美中文字幕制服| 久久成人久久鬼色| 国产亚洲欧美在线| 国产91精品一区二区| 国产精品情趣视频| 99久久久久久| 亚洲制服欧美中文字幕中文字幕| 欧美综合久久久| 亚洲国产综合人成综合网站| 成人欧美一区二区三区视频网页 | 亚洲精品免费看| 色婷婷久久综合| 亚洲高清视频在线| 91精品国产综合久久福利软件| 日本欧美在线看| 精品国产91久久久久久久妲己| 久久99日本精品| 国产亚洲欧美激情| kk眼镜猥琐国模调教系列一区二区| 国产精品国产自产拍高清av王其| 99视频精品全部免费在线| 亚洲精选视频免费看| 666欧美在线视频| 国产一区 二区| 亚洲日韩欧美一区二区在线| 欧美性猛片xxxx免费看久爱| 青青草91视频| 国产精品私人自拍| 在线观看亚洲一区| 奇米四色…亚洲| 国产人久久人人人人爽| 色婷婷久久久亚洲一区二区三区 | 欧美xxxx在线观看| 成人免费观看视频| 香蕉久久夜色精品国产使用方法| 日韩一级片网站| 国产高清无密码一区二区三区| 自拍偷在线精品自拍偷无码专区| 欧美在线你懂得| 精品一区二区三区久久| 国产精品狼人久久影院观看方式| 欧美色国产精品| 狠狠久久亚洲欧美| 亚洲综合色噜噜狠狠| 久久综合久久久久88| 在线亚洲一区观看| 国产精品综合二区| 亚洲影视资源网| 国产午夜精品一区二区三区四区| 色综合久久中文字幕| 美女一区二区三区| 中文字幕亚洲精品在线观看| 日韩欧美视频一区| 91猫先生在线| 极品少妇xxxx偷拍精品少妇| 亚洲精品免费电影| 久久精品人人做人人爽人人| ...av二区三区久久精品| 678五月天丁香亚洲综合网| bt7086福利一区国产| 美女网站视频久久| 亚洲男女一区二区三区| 欧美精品一区二区三区一线天视频| 一本大道av一区二区在线播放| 精品一区二区在线观看| 亚洲国产另类av| 国产精品三级在线观看| 日韩午夜激情视频| 在线观看一区不卡| 成人永久免费视频| 理论片日本一区| 性感美女极品91精品| 亚洲欧美在线另类| 久久久天堂av| 日韩三级视频在线观看| 在线观看91视频| 99久久精品99国产精品| 国产九色精品成人porny | 日韩欧美中文字幕制服| 欧美午夜精品久久久久久超碰 | 亚洲精品国产第一综合99久久| 国产欧美日韩精品在线| 精品国产乱码久久久久久影片| 欧美精品精品一区| 欧美在线综合视频| av电影一区二区| 大美女一区二区三区| 国产一区二区三区电影在线观看| 天涯成人国产亚洲精品一区av| 亚洲老妇xxxxxx| 亚洲人妖av一区二区| 国产日韩在线不卡| 精品久久久久av影院| 日韩欧美国产系列| 欧美精品精品一区| 欧美妇女性影城| 欧美精品亚洲二区| 欧美日韩一区中文字幕| 欧美视频一区二区三区四区 | 日韩精品色哟哟| 天天综合网天天综合色 | 欧美成人性福生活免费看| 欧美一区二区视频在线观看| 91精品国产高清一区二区三区蜜臀 | 中文无字幕一区二区三区| 久久亚洲精品国产精品紫薇| 精品日韩一区二区| 欧美第一区第二区| 精品99久久久久久| 2019国产精品| 日本一区免费视频| 中文字幕日韩av资源站| 中文字幕av在线一区二区三区| 免费成人在线观看视频| 久久超碰97中文字幕| 极品少妇一区二区| 丁香婷婷综合激情五月色| 东方aⅴ免费观看久久av| av亚洲精华国产精华精| 成人app在线| 91福利国产精品| 在线观看91av| 久久亚洲综合av| 亚洲欧洲日产国码二区| 一二三区精品视频|