message: fixing use of Pointer and PointerByReference
diff: @@ -73,11 +73,10 @@ public class WalletTypeInmem extends WalletType {
  String value = wallet.values.get(key);
  - byte[] bytes = Native.toByteArray(value);
  - Pointer pointer = new Memory(bytes.length + 1);
  + byte[] bytes = Native.toByteArray(value, "UTF-8");
  + Pointer pointer = new Pointer(Native.malloc(bytes.length));
  pointer.write(0, bytes, 0, bytes.length);
  - pointer.setByte(bytes.length, (byte) 0);
  - valuePtr.setPointer(pointer);
  + valuePtr.setValue(pointer);
  return ErrorCode.Success;
  }
  @@ -92,11 +91,10 @@ public class WalletTypeInmem extends WalletType {
  String value = wallet.values.get(key);
  - byte[] bytes = Native.toByteArray(value);
  - Pointer pointer = new Memory(bytes.length + 1);
  + byte[] bytes = Native.toByteArray(value, "UTF-8");
  + Pointer pointer = new Pointer(Native.malloc(bytes.length));
  pointer.write(0, bytes, 0, bytes.length);
  - pointer.setByte(bytes.length, (byte) 0);
  - valuePtr.setPointer(pointer);
  + valuePtr.setValue(pointer);
  return ErrorCode.Success;
  }
  @@ -121,11 +119,10 @@ public class WalletTypeInmem extends WalletType {
  builder.append("]");
  - byte[] bytes = Native.toByteArray(builder.toString());
  - Pointer pointer = new Memory(bytes.length + 1);
  + byte[] bytes = Native.toByteArray(builder.toString(), "UTF-8");
  + Pointer pointer = new Pointer(Native.malloc(bytes.length));
  pointer.write(0, bytes, 0, bytes.length);
  - pointer.setByte(bytes.length, (byte) 0);
  - valuesJsonPtr.setPointer(pointer);
  + valuesJsonPtr.setValue(pointer);
  return ErrorCode.Success;
  }
  