I have an "Arraylist" of String format with exact values of byte array like
{-119, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 84, 0, 0, 0, 84, 8, 6, 0, 0}
I have want to convert it back to byte array which looks the same like
{-119, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0, 13, 73, 72, 68, 82, 0, 0, 0, 84, 0, 0, 0, 84, 8, 6, 0, 0}
But i cant find a method to do this I want to this so i can decode an Image out the byte array but no luck
I tried to use this method where "yolo" is my arraylist but the output bytearray has differnet values why ?
ByteArrayOutputStream lp = new ByteArrayOutputStream();
DataOutputStream out = new DataOutputStream(lp);
for (String element : yolo)
{
try
{
out.writeUTF(element);
}catch(IOException e)
{
e.printStackTrace();
}
}
byte myimage[] = lp.toByteArray();