org.hcilab.btprinter.platform.j2me
Class IOHandlerImpl

java.lang.Object
  extended by org.hcilab.btprinter.platform.j2me.IOHandlerImpl
All Implemented Interfaces:
org.hcilab.btprinter.abstractionlayer.IOHandler

public class IOHandlerImpl
extends java.lang.Object
implements org.hcilab.btprinter.abstractionlayer.IOHandler

This is an implementation of the IOHandler interface for the java 2 micro edition (J2ME). A javax.microedition.io.Connector is used to establish the bluetooth connection to the printer. Use a protocol identifier like btspp://0002c7207ba7:1 as identifier to connect.

Version:
1.0.0
Author:
Dominik Schmidt

Field Summary
private  javax.microedition.io.StreamConnection connection
          Connection to the printer.
private  java.io.InputStream in
          Associated input stream.
private  org.hcilab.btprinter.abstractionlayer.LogHandler logHandler
          Log handler.
private  java.io.OutputStream out
          Associated output stream.
 
Constructor Summary
IOHandlerImpl()
           
 
Method Summary
 void connect(java.lang.String id)
           
 void disconnect()
           
 java.io.InputStream getInputStream()
           
 java.io.OutputStream getOutputStream()
           
 boolean isConnected()
           
 void setLogHandler(org.hcilab.btprinter.abstractionlayer.LogHandler logHandler)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection

private javax.microedition.io.StreamConnection connection
Connection to the printer.


in

private java.io.InputStream in
Associated input stream.


logHandler

private org.hcilab.btprinter.abstractionlayer.LogHandler logHandler
Log handler.


out

private java.io.OutputStream out
Associated output stream.

Constructor Detail

IOHandlerImpl

public IOHandlerImpl()
Method Detail

connect

public void connect(java.lang.String id)
             throws java.io.IOException
Specified by:
connect in interface org.hcilab.btprinter.abstractionlayer.IOHandler
Throws:
java.io.IOException

disconnect

public void disconnect()
Specified by:
disconnect in interface org.hcilab.btprinter.abstractionlayer.IOHandler

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Specified by:
getInputStream in interface org.hcilab.btprinter.abstractionlayer.IOHandler
Throws:
java.io.IOException

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Specified by:
getOutputStream in interface org.hcilab.btprinter.abstractionlayer.IOHandler
Throws:
java.io.IOException

isConnected

public boolean isConnected()
Specified by:
isConnected in interface org.hcilab.btprinter.abstractionlayer.IOHandler

setLogHandler

public void setLogHandler(org.hcilab.btprinter.abstractionlayer.LogHandler logHandler)
Specified by:
setLogHandler in interface org.hcilab.btprinter.abstractionlayer.IOHandler