How can I write byte array in Dart?
问题 How do I write a byte array in Dart? I want to implement this function, but it is Java code with byte[] in it. Can it be written in Dart as well? public static byte[] encrypt(byte[] key, byte[] data) throws Exception { try { return performCipher(Cipher.ENCRYPT_MODE, key, data); } catch (Exception e) { throw new Exception(e); } } 回答1: What you are looking for is Uint8List . It is the equivalent of byte[] of Java in Dart. Every single value has an equivalent in another language, so byte[] in a