is possible to convert FileOutputStream to byte array?
问题 I want to convert FileOutputStream to Byte array for passing binary data between two applications. please any one can help? 回答1: To convert a file to byte array, ByteArrayOutputStream class is used. This class implements an output stream in which the data is written into a byte array. The buffer automatically grows as data is written to it. The data can be retrieved using toByteArray() and toString(). To convert byte array back to the original file, FileOutputStream class is used. A file