Hey,
Im stuck trying to figure out how to insert one byte between two other bytes that have already been created in an output stream:
OutputStream out = new FileOutputStream("MyFile");
try {
out.write((byte) 70);
/*Byte should be inserted between these elements*/
out.write((byte) 40);
/* but must be performed at end of try, as it is total file size of all bytes*/
out.write((byte)out.getCount()); // my method for getting file size works
}
I just need a way for the last out.write, to write the byte between the already existing 70, and 40 bytes previously written. I tried the extended way with an offset and length but it always throws an error, any suggestions?