Welcome,
I have a byte[] which is the binary representation of a String. And I wanted to replace a part of this String and get back the new byte[]!
I have tried:
String string = new String(array);
string = string.replace("#+#","SOME STRING");
array = string.getBytes();
The problem is that array is that the array afterwards is something different and not only because of the replacement.
The content of the array are serialized objects seperated with "#+#".
FileOutputStream fos = new FileOutputStream(target.getPathAsString()); ObjectOutputStream oos = new ObjectOutputStream(fos); oos.writeObject(T); oos.close(); fos.close();