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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? receivestate.java

?? symbian的藍(lán)牙名片交換源代碼
?? JAVA
字號:
// Copyright 2006 Nokia Corporation.
//
// THIS SOURCE CODE IS PROVIDED 'AS IS', WITH NO WARRANTIES WHATSOEVER,
// EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS
// FOR ANY PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE
// OR TRADE PRACTICE, RELATING TO THE SOURCE CODE OR ANY WARRANTY OTHERWISE
// ARISING OUT OF ANY PROPOSAL, SPECIFICATION, OR SAMPLE AND WITH NO
// OBLIGATION OF NOKIA TO PROVIDE THE LICENSEE WITH ANY MAINTENANCE OR
// SUPPORT. FURTHERMORE, NOKIA MAKES NO WARRANTY THAT EXERCISE OF THE
// RIGHTS GRANTED HEREUNDER DOES NOT INFRINGE OR MAY NOT CAUSE INFRINGEMENT
// OF ANY PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OWNED OR CONTROLLED
// BY THIRD PARTIES
//
// Furthermore, information provided in this source code is preliminary,
// and may be changed substantially prior to final release. Nokia Corporation
// retains the right to make changes to this source code at
// any time, without notice. This source code is provided for informational
// purposes only.
//
// Nokia and Nokia Connecting People are registered trademarks of Nokia
// Corporation.
// Java and all Java-based marks are trademarks or registered trademarks of
// Sun Microsystems, Inc.
// Other product and company names mentioned herein may be trademarks or
// trade names of their respective owners.
//
// A non-exclusive, non-transferable, worldwide, limited license is hereby
// granted to the Licensee to download, print, reproduce and modify the
// source code. The licensee has the right to market, sell, distribute and
// make available the source code in original or modified form only when
// incorporated into the programs developed by the Licensee. No other
// license, express or implied, by estoppel or otherwise, to any other
// intellectual property rights is granted herein.
package bcexchanger.comm;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import javax.microedition.io.Connector;
import javax.obex.ClientSession;
import javax.obex.HeaderSet;
import javax.obex.Operation;
import javax.obex.ResponseCodes;

/**
 * 
 * This class implements business card receiving state. In this state
 * an client OBEX GET operation is peformed. No OBEX server commands
 * are served.
 * 
 * This class extends ExchangerState abstract class.
 * 
 * @version 1.0 29.09.2005
 * @see bcexchanger.comm.ExchangerState Design Patterns: State
 */
public class ReceiveState extends ExchangerState{

  // Instance variables
  private ClientSession connection = null;
  private Operation operation = null;
  String url = null;

  boolean cancelInvoked = false; // true after cancelSending is
                                  // called

  /**
   * Constructor
   * <p>
   * description
   * 
   * @param _parent -
   *          the class which is nesting the current state of the
   *          state machine
	 * @param _url -
	 *            a URL of the remote OBEX service. This state is responsible
	 *            for establishin the connection
   * @exception
   * @see
   */
  public ReceiveState(ExchangerStateParent _parent,
      String url) 
  {
    super(_parent);
    this.url = url;
  }

  /*
   * ReceiveState does not allow to start any other business card
   * exchange process.
   * 
   * @see bcexchanger.comm.ExchangerState#startSending()
   */
  public void startSending(int to) throws IOException {

    throw new IOException(
        "Receiving is in progress. Receiving has to be canceled before starting new sending process");

  }

  /*
   * ReceiveState allows to cancel receiving process.
   * 
   * @see bcexchanger.comm.ExchangerState#cancelSending()
   */
  public void cancelSending() {
    cancelInvoked = true;

    try { // cancel any active operation running
      operation.abort();
    } catch (IOException e) {
      // Ignore, aborting operation anyway
    }

    try { // send DISCONNECT command to the remote peer
      connection.disconnect(null);
    } catch (IOException e1) {
        // Ignore, disconnecting anyway
    }

  }

  /*
   * This method implements the logic for
   * receving a business card
   * 
   */
  public void doGet()
  {
	  try 
	  {
		  connection = (ClientSession) Connector.open(url);
		  HeaderSet response = connection.connect(null);
		  operation = connection.get(null);
		  InputStream in = operation.openInputStream();
		  byte[] fullResult = null; 
		  {
			  byte[] buf = new byte[256];
			  ByteArrayOutputStream bout = new ByteArrayOutputStream(2048);
			  for (int len = in.read(buf); len >= 0; len = in.read(buf))
    		  {	
    		  	bout.write(buf, 0, len);
    		  } 
			  fullResult = bout.toByteArray();
		  }   
		  ByteArrayInputStream bin = new ByteArrayInputStream(fullResult);
		  DataInputStream din = new DataInputStream(bin);
		  int size = din.readInt();    
		  byte[] vCard = new byte[size];
		  din.read(vCard);
		  
		  parent.getListener().onReceiveBC(vCard);
		 
		  // End the transaction
		  in.close();
		  int responseCode = operation.getResponseCode();
	
		  operation.close();
		  
		  if (cancelInvoked) {
			  throw new Exception(
			  "Cancel did not invoke any exception; throw exception then");
		  }

		  // receive is done
		  try 
		  
		  {
			  parent.setState(new IdleState(parent));
			  parent.getListener().onReceiveComplete(ExchangerComm.DONE);
		  } 
		  catch (Exception e) 
		  {
		  }

    } 
	catch (Exception e1) 
	{
      if (cancelInvoked)
      { // if exception was caused by canceling
    	  parent.setState(new IdleState(parent));
        parent.getListener()
            .onReceiveComplete(ExchangerComm.CANCELED);
      } 
      else 
      { // if exception was caused by error
    	  
    	parent.setState(new IdleState(parent));
        parent.getListener().onReceiveComplete(ExchangerComm.ERROR);
      }
    } 
	finally 
	{
      try { // finalizing operation
        operation.close();
      } catch (IOException e3) 
      {
      }

      try { // sending DISCONNECT command
        connection.disconnect(null);
      } catch (IOException e2) 
      {
        // Ignore, disconnecting anyway
      }
      

    }
  }
  
  /*
   * Server OBEX GET command is supported only in
   * IdleState
   * 
   * @see bcexchanger.comm.ExchangerState#onGet(javax.obex.Operation)
   */
  public int onGet(Operation op) {
    return ResponseCodes.OBEX_HTTP_CONFLICT;
  }

  /*
   * Server OBEX PUT command is supported only in
   * IdleState
   * 
   * @see bcexchanger.comm.ExchangerState#onPut(javax.obex.Operation)
   */
  public int onPut(Operation op) {
    return ResponseCodes.OBEX_HTTP_CONFLICT;
  }


}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区二区三区免费视频| 国产精品理论片在线观看| 在线观看91视频| 成人免费高清在线| 成人小视频免费观看| 激情五月激情综合网| 国产麻豆视频一区| 不卡的看片网站| 91视频观看免费| 欧美色图一区二区三区| 欧美裸体一区二区三区| 制服.丝袜.亚洲.另类.中文| 欧洲国内综合视频| 色综合久久中文综合久久牛| 欧美三级电影一区| 精品久久久久久久人人人人传媒| 日韩女优电影在线观看| 国产无遮挡一区二区三区毛片日本| 久久久噜噜噜久噜久久综合| 亚洲女性喷水在线观看一区| 亚洲va欧美va天堂v国产综合| 亚洲chinese男男1069| 亚洲色欲色欲www在线观看| 亚洲福利一二三区| 精品一区二区三区免费播放| 不卡的av网站| 99精品在线免费| 色综合久久天天| 久久久www成人免费无遮挡大片| 中文字幕乱码日本亚洲一区二区| 一区二区三区欧美日| 久久超级碰视频| 欧美中文字幕一二三区视频| 国产精品嫩草99a| 久久国产综合精品| 欧美精品自拍偷拍| 亚洲色图制服丝袜| 国产一区欧美二区| 日韩欧美一区电影| 五月综合激情婷婷六月色窝| 国产寡妇亲子伦一区二区| 欧美在线免费播放| 亚洲欧洲日韩综合一区二区| 国产精品一区免费在线观看| 日韩美女在线视频| 亚洲午夜在线视频| 欧美日韩视频第一区| 日本不卡的三区四区五区| 日韩免费观看高清完整版在线观看| 亚洲国产一区视频| 欧美肥妇毛茸茸| 日韩电影在线免费观看| 日韩一区二区三区免费看 | 国产亚洲一区二区三区在线观看| 五月婷婷激情综合网| 欧美日韩色一区| 老司机精品视频在线| 26uuu国产一区二区三区| 国产精品一卡二卡在线观看| 国产精品乱人伦| 4438x成人网最大色成网站| 九色porny丨国产精品| 国产亚洲精品久| 色婷婷激情综合| 国产麻豆精品久久一二三| 亚洲视频在线一区观看| 欧美精三区欧美精三区| 国产一区二区三区最好精华液| 久久精品一区二区三区不卡牛牛 | 日韩一区二区三区视频| 成人免费看片app下载| 调教+趴+乳夹+国产+精品| 国产亚洲成av人在线观看导航| 91精彩视频在线观看| 国产自产v一区二区三区c| 亚洲激情图片小说视频| 国产日韩精品视频一区| 91精品国产综合久久香蕉麻豆 | 久久中文字幕电影| 51精品国自产在线| 9i在线看片成人免费| 视频一区二区不卡| 五月综合激情婷婷六月色窝| 一区二区三区不卡在线观看| 国产调教视频一区| 久久这里只有精品视频网| 在线播放日韩导航| 欧美精品一二三区| 欧美日韩一本到| 欧美老肥妇做.爰bbww视频| 欧美色图第一页| 国产精品午夜久久| 在线电影院国产精品| 欧美日韩精品免费| 欧美日韩国产经典色站一区二区三区 | 久久人人97超碰com| 2欧美一区二区三区在线观看视频 337p粉嫩大胆噜噜噜噜噜91av | 日日骚欧美日韩| 午夜久久电影网| 亚洲成人免费视| 国产一区 二区 三区一级| 国产成人av影院| 在线亚洲精品福利网址导航| 欧美影院一区二区| 欧美日产国产精品| 51久久夜色精品国产麻豆| 欧美成人一区二区三区片免费 | 首页综合国产亚洲丝袜| 精品一区二区三区免费视频| 91欧美激情一区二区三区成人| 在线精品国精品国产尤物884a| 制服丝袜亚洲播放| 国产精品国产三级国产| 美女mm1313爽爽久久久蜜臀| 91啪在线观看| 久久免费视频一区| 午夜精品久久久久久久久久久| 国产麻豆精品95视频| 欧美日韩在线电影| 国产精品久久久久久久久动漫| 亚洲精品视频一区| 成人深夜福利app| 欧美成人精品3d动漫h| 亚洲精品成人精品456| 成人丝袜18视频在线观看| 日韩欧美一区中文| 视频精品一区二区| 在线精品观看国产| 亚洲已满18点击进入久久| av在线不卡观看免费观看| 久久久久久99久久久精品网站| 日韩国产欧美在线观看| 欧美日韩三级一区| 亚洲电影一级片| 69堂精品视频| 精品一区二区免费看| 欧美一二区视频| 国产麻豆日韩欧美久久| 2欧美一区二区三区在线观看视频| 午夜av区久久| 久久综合色婷婷| 国产91高潮流白浆在线麻豆 | 激情亚洲综合在线| 久久免费电影网| 91欧美一区二区| 日韩精品乱码av一区二区| 91精品国产欧美日韩| 国产在线视频不卡二| 国产精品久久久久久久蜜臀| eeuss鲁片一区二区三区| 一区二区三区日本| 欧美一二三区精品| 91蜜桃网址入口| 午夜一区二区三区视频| 欧美一区二区三区小说| 国产v综合v亚洲欧| 亚洲二区视频在线| 欧美激情一区二区| 91麻豆精品国产91久久久久久| 国产在线不卡一卡二卡三卡四卡| 中文字幕一区二区三区色视频| 日本精品视频一区二区| 韩国女主播一区二区三区| 依依成人综合视频| 久久精品亚洲国产奇米99| 欧美精品亚洲一区二区在线播放| 亚洲国产综合视频在线观看| 精品国产一区二区三区不卡| 色av综合在线| 91丨porny丨首页| 不卡电影一区二区三区| 国产成人亚洲综合色影视| 热久久一区二区| 亚洲国产综合91精品麻豆| 国产精品久久久久影院亚瑟| 国产欧美一区二区三区沐欲| 日韩一区二区在线看| 欧美亚洲国产一卡| 色视频一区二区| 欧美美女喷水视频| 欧美日韩成人高清| 在线观看91av| 精品国产一区二区三区久久影院| 91精品国产综合久久小美女| 欧美一二区视频| 久久久久久久久久美女| 日本一区二区三区视频视频| 国产日产欧美一区| 中文字幕一区二区三区精华液| 亚洲情趣在线观看| 日本亚洲视频在线| 国产乱码精品一品二品| 国产91色综合久久免费分享| 福利一区二区在线| 日本韩国视频一区二区| 欧美一级日韩免费不卡| 亚洲国产成人一区二区三区| 一区二区在线观看视频| 男女视频一区二区| 91丝袜美女网|