public byte[] getExifRawData(final ByteSource byteSource) throws ImagingException, IOException {
        final List<AbstractSegment> abstractSegments = readSegments(byteSource, new int[] { JpegConstants.JPEG_APP1_MARKER, }, false);

        if (abstractSegments == null || abstractSegments.isEmpty()) {
            return null;
        }

        final List<AbstractSegment> exifSegments = filterApp1Segments(abstractSegments);
        if (LOGGER.isLoggable(Level.FINEST)) {
            LOGGER.finest("exifSegments.size()" + ": " + exifSegments.size());
        }

        // Debug.debug("segments", segments);
        // Debug.debug("exifSegments", exifSegments);

        // TODO: concatenate if multiple segments, need example.
        if (exifSegments.isEmpty()) {
            return null;
        }
        if (exifSegments.size() > 1) {
            throw new ImagingException(
                    "Imaging currently can't parse EXIF metadata split across multiple APP1 segments.  " + "Please send this image to the Imaging project.");
        }

        final AbstractGenericSegment segment = (AbstractGenericSegment) exifSegments.get(0);
        final byte[] bytes = segment.getSegmentData();

        // byte[] head = readBytearray("exif head", bytes, 0, 6);
        //
        // Debug.debug("head", head);

        return remainingBytes("trimmed exif bytes", bytes, 6);
    }
Constructs a new instance with the big-endian byte order.
src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java