Java: unwanted characters at the beginning of a file as result of serialization

Posted by Patrick on Stack Overflow See other posts from Stack Overflow or by Patrick
Published on 2010-05-10T08:33:09Z Indexed on 2010/05/10 8:54 UTC
Read the original article Hit count: 197

Filed under:

hi,

when I write a new text file in Java, I get these characters at the beginning of the file:

¨Ìt

This is the code:

public static void writeMAP(String filename, Object object) throws IOException {
    ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(filename));
    oos.writeObject(object);
    oos.close();
}

thanks

© Stack Overflow or respective owner

Related posts about java