@Test public void testSupportCode() throws Exception { final InputStream in = createUtf8DataStream(new byte[] { 'A', 'B' }, true); final byte[] buf = new byte[1024]; final int len = in.read(buf); assertEquals(5, len); assertEquals(0xEF, buf[0] & 0xFF); assertEquals(0xBB, buf[1] & 0xFF); assertEquals(0xBF, buf[2] & 0xFF); assertEquals('A', buf[3] & 0xFF); assertEquals('B', buf[4] & 0xFF); assertData( new byte[] { (byte) 0xEF, (byte) 0xBB, (byte) 0xBF, 'A', 'B' }, buf, len); }
@Override public int read() throws IOException { final int b = readFirstBytes(); return b >= 0 ? b : in.read(); }
BOMInputStream extends ProxyInputStream { @Override public int read() throws IOException { final int b = readFirstBytes(); return b >= 0 ? b : in.read(); } }
BOMInputStream extends ProxyInputStream { @Override public int read() throws IOException { final int b = readFirstBytes(); return b >= 0 ? b : in.read(); } BOMInputStream(final InputStream delegate);  BOMInputStream(final InputStream delegate, final boolean include);  BOMInputStream(final InputStream delegate, final ByteOrderMark... boms);  BOMInputStream(final InputStream delegate, final boolean include, final ByteOrderMark... boms); }
BOMInputStream extends ProxyInputStream { @Override public int read() throws IOException { final int b = readFirstBytes(); return b >= 0 ? b : in.read(); } BOMInputStream(final InputStream delegate);  BOMInputStream(final InputStream delegate, final boolean include);  BOMInputStream(final InputStream delegate, final ByteOrderMark... boms);  BOMInputStream(final InputStream delegate, final boolean include, final ByteOrderMark... boms); boolean hasBOM(); boolean hasBOM(final ByteOrderMark bom); ByteOrderMark getBOM(); String getBOMCharsetName(); @Override int read(); @Override int read(final byte[] buf, int off, int len); @Override int read(final byte[] buf); @Override synchronized void mark(final int readlimit); @Override synchronized void reset(); @Override long skip(long n); }
BOMInputStream extends ProxyInputStream { @Override public int read() throws IOException { final int b = readFirstBytes(); return b >= 0 ? b : in.read(); } BOMInputStream(final InputStream delegate);  BOMInputStream(final InputStream delegate, final boolean include);  BOMInputStream(final InputStream delegate, final ByteOrderMark... boms);  BOMInputStream(final InputStream delegate, final boolean include, final ByteOrderMark... boms); boolean hasBOM(); boolean hasBOM(final ByteOrderMark bom); ByteOrderMark getBOM(); String getBOMCharsetName(); @Override int read(); @Override int read(final byte[] buf, int off, int len); @Override int read(final byte[] buf); @Override synchronized void mark(final int readlimit); @Override synchronized void reset(); @Override long skip(long n);  }