PenProfile 2.x

com.sun.cldc.io.j2me.socket
Class Protocol

java.lang.Object
  extended by com.sun.cldc.io.j2me.socket.Protocol
All Implemented Interfaces:
ConnectionBaseInterface, Connection, InputConnection, OutputConnection, StreamConnection

public class Protocol
extends Object
implements ConnectionBaseInterface, StreamConnection

Connection to the J2ME socket API.


Field Summary
protected  boolean isopen
          Input stream open flag
protected  boolean osopen
          Output stream open flag
 
Constructor Summary
Protocol()
           
 
Method Summary
protected static int available0(int handle)
           
 void close()
          Close the connection.
protected static void close0(int handle)
           
 void open(int handle, int mode)
          Open the connection
 void open(String name, int mode, boolean timeouts)
          Open the connection
protected static int open0(byte[] hostname, int port, int mode)
           
 DataInputStream openDataInputStream()
          Open and return a data input stream for a connection.
 DataOutputStream openDataOutputStream()
          Open and return a data output stream for a connection.
 InputStream openInputStream()
          Returns an input stream for this socket.
 OutputStream openOutputStream()
          Returns an output stream for this socket.
 Connection openPrim(String name, int mode, boolean timeouts)
          Open the connection
protected static int readBuf(int handle, byte[] b, int off, int len)
           
protected static int readByte(int handle)
           
protected static int writeBuf(int handle, byte[] b, int off, int len)
           
protected static int writeByte(int handle, int b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isopen

protected boolean isopen
Input stream open flag


osopen

protected boolean osopen
Output stream open flag

Constructor Detail

Protocol

public Protocol()
Method Detail

open

public void open(String name,
                 int mode,
                 boolean timeouts)
          throws IOException
Open the connection

Throws:
IOException

openPrim

public Connection openPrim(String name,
                           int mode,
                           boolean timeouts)
                    throws IOException
Open the connection

Specified by:
openPrim in interface ConnectionBaseInterface
Parameters:
name - the target for the connection. It must be in this format: "//:"
mode - read/write mode of the connection (currently ignored).
timeouts - A flag to indicate that the called wants timeout exceptions (currently ignored).
Throws:
IOException

open

public void open(int handle,
                 int mode)
          throws IOException
Open the connection

Parameters:
handle - an already formed socket handle

This function is only used by com.sun.cldc.io.j2me.socketserver;

Throws:
IOException

openInputStream

public InputStream openInputStream()
                            throws IOException
Returns an input stream for this socket.

Specified by:
openInputStream in interface InputConnection
Returns:
an input stream for reading bytes from this socket.
Throws:
IOException - if an I/O error occurs when creating the input stream.

openOutputStream

public OutputStream openOutputStream()
                              throws IOException
Returns an output stream for this socket.

Specified by:
openOutputStream in interface OutputConnection
Returns:
an output stream for writing bytes to this socket.
Throws:
IOException - if an I/O error occurs when creating the output stream.

close

public void close()
           throws IOException
Close the connection.

Specified by:
close in interface Connection
Throws:
IOException - if an I/O error occurs when closing the connection.

openDataInputStream

public DataInputStream openDataInputStream()
                                    throws IOException
Open and return a data input stream for a connection.

Specified by:
openDataInputStream in interface InputConnection
Returns:
An input stream
Throws:
IOException - If an I/O error occurs

openDataOutputStream

public DataOutputStream openDataOutputStream()
                                      throws IOException
Open and return a data output stream for a connection.

Specified by:
openDataOutputStream in interface OutputConnection
Returns:
An input stream
Throws:
IOException - If an I/O error occurs

open0

protected static int open0(byte[] hostname,
                           int port,
                           int mode)

readBuf

protected static int readBuf(int handle,
                             byte[] b,
                             int off,
                             int len)

readByte

protected static int readByte(int handle)

writeBuf

protected static int writeBuf(int handle,
                              byte[] b,
                              int off,
                              int len)

writeByte

protected static int writeByte(int handle,
                               int b)

available0

protected static int available0(int handle)

close0

protected static void close0(int handle)

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.