public void connectionclose() {
   try {
     is.close();
     os.close();
     dis.close();
     dos.close();
     sPort.close();
   } catch (Exception e) {
     System.out.println("close" + e);
   }
 }
예제 #2
0
  public void write(byte[] data) {
    try {
      os = port.getOutputStream();
    } catch (IOException e) {
      System.err.println("IOException: " + e);
    }

    try {
      os.write(data);
    } catch (IOException e) {
      System.err.println("IOException: " + e);
    }
  }