public void testCreateWithInputStream() throws Exception
{
File jpeg = new File("src/com/drew/metadata/exif/test/withExif.jpg");
InputStream in = new FileInputStream(jpeg);
JpegSegmentReader reader = null;
try {
reader = new JpegSegmentReader(in);
} catch (JpegProcessingException e) {
fail("Error constructing JpegSegmentReader using InputStream");
}
// this will never happen, as fail() is guaranteed to throw an AssertionException
if (reader==null)
return;
byte[] exifData = reader.readSegment(JpegSegmentReader.SEGMENT_APP1);
assertEquals("Exif", new String(exifData, 0, 4));
}