Class PrettyPrinter


  • public final class PrettyPrinter
    extends Object
    Utility class to extract String representations of heap dump objects.
    • Method Detail

      • objectAsString

        public static String objectAsString​(IObject stringObject,
                                            int limit)
                                     throws SnapshotException
        Convert a java.lang.String object into a String.
        Parameters:
        stringObject - the String object in the dump
        limit - maximum number of characters to return
        Returns:
        the value of the string from the dump, as a String
        Throws:
        SnapshotException
      • arrayAsString

        public static String arrayAsString​(IPrimitiveArray charArray,
                                           int offset,
                                           int count,
                                           int limit)
        Convert a char[] object into a String. Unprintable characters are returned as \\unnnn values
        Parameters:
        charArray -
        offset - where to start
        count - how many characters to read
        limit - the maximum number of characters to read
        Returns:
        the characters as a string