@Test
    public void testBZ2Detection() throws Exception {
        Detector detector = new TikaConfig().getDetector();
        for (String bz2 : new String[]{"bzip2-8-file.txt.bz2",
                "empty-file.txt.bz2", "lbzip2-8-file.txt.bz2",
                "small-file.txt.bz2", "test-file-1.csv.bz2",
                "test-file-2.csv.bz2"}) {
            assertEquals("application/x-bzip2", detect(detector, bz2));
        }
    }
Prevent reading the entire len of bytes if requesting more
than 10 bytes.
tika-core/src/test/java/org/apache/tika/detect/MagicDetectorTest.java