@Test
public void testDetectApplicationEnviHdr() throws Exception {

    InputStream iStream = MagicDetectorTest.class.getResourceAsStream(
          "/test-documents/ang20150420t182050_corr_v1e_img.hdr");
    byte[] data = IOUtils.toByteArray(iStream);
    MediaType testMT = new MediaType("application", "envi.hdr");
    Detector detector = new MagicDetector(testMT, data, null, false, 0, 0);
    // Deliberately prevent InputStream.read(...) from reading the entire
    // buffer in one go
    InputStream stream = new RestrictiveInputStream(data);
    assertEquals(testMT, detector.detect(stream, new Metadata()));
}