java - Efficiently removing UTF Byte order Mark -


this question has answer here:

i looking efficient solution following problem:

org.xml.sax.saxparseexception: content not allowed in prolog

the problem skipping (or removing) first 3 bom bytes (if present) before unmarshalling file (using jaxb).

i can work checking first 3 bytes , writing after new file , using new file, seems horribly inefficient.

i have tried moving file pointer on 3 bytes if bom present (and verified pointer position ofc.) , when pass inputstream jaxb still throws same exception; gut instinct being file pointer being reset.

does have ideas this?

thanks

use inputstream decoractor strips bom such bominputstream apache commons io.


Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -