DataOutputStream byteOut = new dataoutputstream (baos);
byte[] data = stringArray.get(i)。 getBytes(“UTF-8”); -Here's the key.
ByteOut.write (data);
byte out . close();
byte[]input = baos . tobytearray();
You can convert a string into a byte array. Generally, an input stream cannot exceed 64k, and you can also split it into four 16k for processing!
The above code can solve your problem, remember to use it.