public byte[] getExifRawData(ByteSource byteSource)
            throws ImageReadException, IOException
    {
        ArrayList segments = readSegments(byteSource,
                new int[] { JPEG_APP1_Marker, }, false);

        if ((segments == null) || (segments.size() < 1))
            return null;

        ArrayList exifSegments = filterAPP1Segments(segments);
        if (debug)
            System.out.println("exif_segments.size" + ": "
                    + exifSegments.size());

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

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

        GenericSegment segment = (GenericSegment) exifSegments.get(0);
        byte bytes[] = segment.bytes;

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

        return getByteArrayTail("trimmed exif bytes", bytes, 6);
    }