@Test public void getTest() throws Exception { LazyImmutableRep rep = new LazyImmutableRep(text, in("some meh text")); assertEquals("some meh text", string(rep.get())); assertEquals("some meh text", string(rep.get())); }
public byte[] get() { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); self.write(out); out.close(); return out.toByteArray(); } catch (IOException err) { throw new RuntimeException(err); } }
LazyImmutableRep implements Representation { public byte[] get() { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); self.write(out); out.close(); return out.toByteArray(); } catch (IOException err) { throw new RuntimeException(err); } } }
LazyImmutableRep implements Representation { public byte[] get() { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); self.write(out); out.close(); return out.toByteArray(); } catch (IOException err) { throw new RuntimeException(err); } } LazyImmutableRep(String contentType, InputStream data); }
LazyImmutableRep implements Representation { public byte[] get() { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); self.write(out); out.close(); return out.toByteArray(); } catch (IOException err) { throw new RuntimeException(err); } } LazyImmutableRep(String contentType, InputStream data); byte[] head(int n); byte[] get(); @Override String contentType(); @Override void write(OutputStream out); @Override String show(); @Override boolean eq(Representation that); }
LazyImmutableRep implements Representation { public byte[] get() { try { ByteArrayOutputStream out = new ByteArrayOutputStream(); self.write(out); out.close(); return out.toByteArray(); } catch (IOException err) { throw new RuntimeException(err); } } LazyImmutableRep(String contentType, InputStream data); byte[] head(int n); byte[] get(); @Override String contentType(); @Override void write(OutputStream out); @Override String show(); @Override boolean eq(Representation that);  }