Exemplo n.º 1
0
 public void setData(byte[] data) {
   String text;
   if (inHexMode()) {
     text = HexAsciiHelper.bytesToHex(data);
   } else {
     text = HexAsciiHelper.bytesToAsciiMaybe(data);
     if (text == null) {
       text = "";
     }
   }
   dataEdit.setText(text);
 }
Exemplo n.º 2
0
 public byte[] getData() {
   String text = dataEdit.getText().toString();
   if (inHexMode()) {
     return HexAsciiHelper.hexToBytes(text);
   } else {
     return text.getBytes();
   }
 }