public JpegPhotoshopMetadata getPhotoshopMetadata(final ByteSource byteSource, final JpegImagingParameters params) throws ImagingException, IOException {
        final List<AbstractSegment> abstractSegments = readSegments(byteSource, new int[] { JpegConstants.JPEG_APP13_MARKER, }, false);

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

        PhotoshopApp13Data photoshopApp13Data = null;

        for (final AbstractSegment s : abstractSegments) {
            final App13Segment segment = (App13Segment) s;

            final PhotoshopApp13Data data = segment.parsePhotoshopSegment(params);
            if (data != null) {
                if (photoshopApp13Data != null) {
                    throw new ImagingException("JPEG contains more than one Photoshop App13 segment.");
                }
                photoshopApp13Data = data;
            }
        }

        if (null == photoshopApp13Data) {
            return null;
        }
        return new JpegPhotoshopMetadata(photoshopApp13Data);
    }
Constructs a new instance with the big-endian byte order.
src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java