|
|||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
Objectcom.docomostar.io.FelicaClientObexConnection
public class FelicaClientObexConnection
OBEX クライアントとしてアドホック通信による連続データ転送を行う場合の接続を定義します。
AdhocDataTransfer.setup(String, String, Hashtable)
メソッドにてアドホック通信のリンクを確立した後に、
Connector.open("obex:/felicaclient")
メソッドを呼び出すと、戻り値として、
本クラスのインスタンスを取得することができます。
上記インスタンスは、Connector.open()
した瞬間に確立していたリンクのみに対して有効です。
現在のリンクが切れ、再度別のリンクが確立したとしても、
このインスタンスは無効のままで、リンクが切れているものとして振る舞います。
ClientObexConnection
クラスの説明にある IrDA 通信のコード例も参考にしてください。
フィールドの概要 |
---|
メソッドの概要 | |
---|---|
void |
close()
この接続をクローズします。 |
void |
connect()
接続を確立します。 |
int |
getContentLength()
コンテンツの長さを取得します。 |
String |
getName()
NAME ヘッダを取得します。 |
int |
getResponseCode()
レスポンスコードを取得します。 |
long |
getTime()
TIME ヘッダを取得します。 |
String |
getType()
TYPE ヘッダを取得します。 |
java.io.DataInputStream |
openDataInputStream()
CLDC の仕様に従って DataInputStream オブジェクトを返す処理を実装します。 |
java.io.DataOutputStream |
openDataOutputStream()
CLDC の仕様に従って DataOutputStream オブジェクトを返す処理を実装します。 |
java.io.InputStream |
openInputStream()
CLDC の仕様に従って InputStream オブジェクトを返す処理を実装します。 |
java.io.OutputStream |
openOutputStream()
CLDC の仕様に従って OutputStream オブジェクトを返す処理を実装します。 |
void |
sendRequest()
リクエストを送信して、レスポンスの受信を完了するまで待ちます。 |
void |
setName(String name)
NAME ヘッダを設定します。 |
void |
setOperation(int operation)
オペレーションコードを設定します。 |
void |
setTime(long time)
TIME ヘッダを設定します。 |
void |
setType(String type)
TYPE ヘッダを設定します。 |
クラス Object から継承されたメソッド |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
メソッドの詳細 |
---|
public void connect() throws java.io.IOException
ClientObexConnection
内の connect
RuntimeException
-
ConnectionException
- java.io.InterruptedIOException
-
FelicaClientObexConnection.close()
・Felica.close()
・AdhocDataTransfer.terminateAdhoc()
呼び出しにより、
通信が中断された場合に発生します。
ConnectionException
- ConnectionException
- java.io.IOException
-
java.io.IOException
-
java.io.IOException
-
public void setOperation(int operation)
ClientObexConnection
内の setOperation
operation
- オペレーションコードを指定します。
RuntimeException
-
IllegalArgumentException
-
IllegalArgumentException
-
public void sendRequest() throws java.io.IOException
このメソッドを呼び出すことによって、それより前にこの接続オブジェクトから 取り出した InputStream, DataInputStream, OutputStream, DataOutputStream が無効になります。 次に InputStream, DataInputStream を取り出した時は、 このオペレーションで受信したデータを読み出す入力ストリームを返します。 また、次に OutputStream, DataOutputStream を取り出した時は、 次のオペ