Package org.eclipse.mat.snapshot.model

# Class PrettyPrinter

java.lang.Object
org.eclipse.mat.snapshot.model.PrettyPrinter

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

## Method Summary

Modifier and Type
Method
Description
`static String`
`arrayAsString(IPrimitiveArray charArray, int offset, int count, int limit)`
Convert a `char[]` object into a String.
`static String`
`objectAsString(IObject stringObject, int limit)`
Convert a `java.lang.String` object into a String.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### 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` - if there is a problem with the conversion

### 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` - the character array
  `offset` - where to start
  `count` - how many characters to read
  `limit` - the maximum number of characters to read
Returns:
  the characters as a string