, . , - . , downvotes.:)
InputStream, mark() reset(), reset, :
InputStream in = new BufferedInputStream(
new FileInputStream(new File("xmlfile.xml")));
in.mark(3);
byte[] maybeBom = new byte[] {
(byte) in.read(), (byte) in.read(), (byte) in.read() };
if(!Arrays.equals(maybeBom, new byte[] { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF })) {
in.reset();
}
BufferedInputStream, FileInputStream mark().