Exemplo n.º 1
0
 public int writePacket(JICPPacket pkt) throws IOException {
   if (sc != null) {
     if (os == null) {
       os = getOutputStream();
     }
     int ret = pkt.writeTo(os);
     os.flush();
     return ret;
   } else {
     throw new IOException("Connection closed");
   }
 }
Exemplo n.º 2
0
 public JICPPacket readPacket() throws IOException {
   if (sc != null) {
     if (is == null) {
       // #MIDP_EXCLUDE_BEGIN
       is = sc.getInputStream();
       // #MIDP_EXCLUDE_END
       /*#MIDP_INCLUDE_BEGIN
       is = sc.openInputStream();
       #MIDP_INCLUDE_END*/
     }
     return JICPPacket.readFrom(is);
   } else {
     throw new IOException("Connection closed");
   }
 }