public final String dumpImageFile(final ByteSource byteSource) throws ImagingException, IOException {
        final StringWriter sw = new StringWriter();
        final PrintWriter pw = new PrintWriter(sw);

        dumpImageFile(pw, byteSource);

        pw.flush();

        return sw.toString();
    }
Writes the ImageInfo and format-specific information for the image content of the specified byte source to a string.

@param byteSource A valid byte source.
@return A valid string.
@throws ImagingException In the event that the specified content does not conform to the format of the specific parser implementation.
@throws IOException      In the event of unsuccessful read or access operation.
src/main/java/org/apache/commons/imaging/AbstractImageParser.java