@Test public void testLargeBufferWithBOM() throws Exception { final byte[] data = new byte[] { 'A', 'B', 'C' }; final InputStream in = new BOMInputStream(createUtf8DataStream(data, true)); final byte[] buf = new byte[1024]; assertData(data, buf, in.read(buf)); in.close(); }
@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);  }