public byte[] receiveSpecLenBytes(int len){
  Log.d(TAG,"receiveSpecLenBytes() entrance: len = " + len);
  try {
    acquireLock();
    mServerSocket.receive(mReceivePacket);
    byte[] recDatas=Arrays.copyOf(mReceivePacket.getData(),mReceivePacket.getLength());
    Log.d(TAG,"received len : " + recDatas.length);
    for (int i=0; i < recDatas.length; i++) {
      Log.e(TAG,"recDatas[" + i + "]:"+ recDatas[i]);
    }
    Log.e(TAG,"receiveSpecLenBytes: " + new String(recDatas));
    if (recDatas.length != len) {
      Log.w(TAG,"received len is different from specific len, return null");
      return null;
    }
    return recDatas;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}

public byte [ ] receiveSpecLenBytes ( int len ) { Log . d ( TAG , "receiveSpecLenBytes() entrance: len = " + len ) ; try { acquireLock ( ) ; mServerSocket . receive ( mReceivePacket ) ; byte [ ] recDatas = Arrays . copyOf ( mReceivePacket . getData ( ) , mReceivePacket . getLength ( ) ) ; Log . d ( TAG , "received len : " + recDatas . length ) ; for ( int i = 0 ; i < recDatas . length ; i ++ ) { Log . e ( TAG , "recDatas[" + i + "]:" + recDatas [ i ] ) ; } Log . e ( TAG , "receiveSpecLenBytes: " + new String ( recDatas ) ) ; if ( recDatas . length != len ) { Log . w ( TAG , "received len is different from specific len, return null" ) ; return null ; } return recDatas ; } catch ( IOException e ) { e . printStackTrace ( ) ; } return null ; }
receive specific length bytes from the port and convert it into string 21 , 24 , - 2 , 52 , - 102 , - 93 , - 60 15 , 18 , fe , 34 , 9a , a3 , c4
