I have a java program that stores a byte array of 128 bytes length in a MySQL "BINARY (128)" field.
Then, with PHP I access to the database and I give the option to export this data into a file, so I unpack() the binary data, and write it into a file.
This file then, has to be read in a Java program that I am writing, but I can't find how I have to read this data. Any suggestion?
I tried with:
ByteArrayOutputStream baos = new ByteArrayOutputStream();
int i = 0;
while (i < 128) {
System.out.println(baos.read());
i++;
}
But bis.read() returns an int, and the byte array I sent to the mysql db was a string: "text".getBytes("utf-8");
Thank you,