@Test public void representationToString() { Representation body = Text("Hello World!"); String actual = HttpObjectUtil.toString(body, "UTF-8"); assertThat(actual, is("Hello World!")); }
public static String toString(Representation r, String charsetName){ try { return new String(toByteArray(r), charsetName); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }
HttpObjectUtil { public static String toString(Representation r, String charsetName){ try { return new String(toByteArray(r), charsetName); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } }
HttpObjectUtil { public static String toString(Representation r, String charsetName){ try { return new String(toByteArray(r), charsetName); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }  }
HttpObjectUtil { public static String toString(Representation r, String charsetName){ try { return new String(toByteArray(r), charsetName); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }  static Response invokeMethod(HttpObject object, final Method m, final Request input); static byte[] toByteArray(Representation r); static String toAscii(Representation r); static String toUtf8(Representation r); static String toString(Representation r, String charsetName); }
HttpObjectUtil { public static String toString(Representation r, String charsetName){ try { return new String(toByteArray(r), charsetName); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } }  static Response invokeMethod(HttpObject object, final Method m, final Request input); static byte[] toByteArray(Representation r); static String toAscii(Representation r); static String toUtf8(Representation r); static String toString(Representation r, String charsetName);  }