@Override
    public boolean dumpImageFile(final PrintWriter pw, final ByteSource byteSource) throws ImagingException, IOException {
        pw.println("jpeg.dumpImageFile");

        {
            final ImageInfo imageInfo = getImageInfo(byteSource);
            if (imageInfo == null) {
                return false;
            }

            imageInfo.toString(pw, "");
        }

        pw.println("");

        {
            final List<AbstractSegment> abstractSegments = readSegments(byteSource, null, false);

            if (abstractSegments == null) {
                throw new ImagingException("No Segments Found.");
            }

            for (int d = 0; d < abstractSegments.size(); d++) {

                final AbstractSegment abstractSegment = abstractSegments.get(d);

                final NumberFormat nf = NumberFormat.getIntegerInstance();
                // this.debugNumber("found, marker: ", marker, 4);
                pw.println(d + ": marker: " + Integer.toHexString(abstractSegment.marker) + ", " + abstractSegment.getDescription() + " (length: "
                        + nf.format(abstractSegment.length) + ")");
                abstractSegment.dump(pw);
            }

            pw.println("");
        }

        return true;
    }
Constructs a new instance with the big-endian byte order.
src/main/java/org/apache/commons/imaging/formats/jpeg/JpegImageParser.java