EbtsParser { public static Ebts parse(final byte[] bytes, final ParseType parseType) throws EbtsParsingException { return EbtsParser.parse(bytes,parseType,Type7Handling.TREAT_AS_TYPE4); } EbtsParser(); static Ebts parse(final byte[] bytes, final ParseType parseType); static Ebts parse(final byte[] bytes, Type7Handling type7Handling); static Ebts parse(final byte[] bytes, final ParseType parseType, Type7Handling type7Handling); static Ebts parse(final byte[] bytes); static Ebts parse(final File file, final ParseType parseType, final Type7Handling type7Handling); static Ebts parse(final File file, final ParseType parseType); static Ebts parse(final File file); @Deprecated static Ebts parse(final String filePath, final ParseType parseType);  }
@Test public void testDescriptiveOnly() throws Exception { File file = new File(ClassLoader.getSystemResource("EFT/S001-01-t10_01.eft").toURI()); EbtsParser ebtsParser = new EbtsParser(); Ebts ebtsDescriptiveOnly = ebtsParser.parse(file,ParseType.DESCRIPTIVE_ONLY); Ebts ebts = ebtsParser.parse(file,ParseType.FULL); assertEquals(2,ebtsDescriptiveOnly.getAllRecords().size()); assertEquals(ebts.getRecordsByType(1).get(0).getLength(),ebtsDescriptiveOnly.getRecordsByType(1).get(0).getLength()); assertEquals(ebts.getRecordsByType(2).get(0).getLength(),ebtsDescriptiveOnly.getRecordsByType(2).get(0).getLength()); }
@Test public void type10EmptyImageTest() throws Exception { File file = new File(ClassLoader.getSystemResource("EFT/empty_image.eft").toURI()); EbtsParser ebtsParser = new EbtsParser(); Ebts ebts = ebtsParser.parse(file,ParseType.FULL); assertNotNull(ebts); GenericRecord type10 = (GenericRecord) ebts.getRecordsByType(10).get(0); assertFalse(type10.getFields().isEmpty()); assertEquals("JPEGB",type10.getField(11).toString()); assertFalse(type10.hasImageData()); }