Class ContentTypeDetectingInputStreamWrapper

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class ContentTypeDetectingInputStreamWrapper
    extends BufferedInputStream
    This class wraps an input stream and detects if it contains certain content using "magic numbers". ...

    currently only pdf detection is implemented

    Author:
    mwyraz
    • Field Detail

      • MAGIC_BYTES

        protected final byte[] MAGIC_BYTES
      • MAGIC_BYTES_PDF

        protected static final byte[] MAGIC_BYTES_PDF
    • Method Detail

      • streamStartsWithMagicBytes

        protected boolean streamStartsWithMagicBytes​(byte[] bytes)
      • isPdf

        public boolean isPdf()