/** * Get a string representation of the entire buffer. */ @Override public String toString() { return out.getByteArrayStream().toString(); }
protected String readDataHeaderString(final String encoding) throws IOException { FastByteArrayOutputStream data = new FastByteArrayOutputStream(); byte b; while (true) { // end marker byte on offset +0 and +2 must be 13 if ((b = readByte()) != '\r') { data.write(b); continue; } mark(4); skipBytes(1); int i = read(); if (i == -1) { // reached end of stream return null; } if (i == '\r') { reset(); break; } reset(); data.write(b); } skipBytes(3); if (encoding != null) { return data.toString(encoding); } else { return data.toString(); } }
assertEquals("one ctor!one ctor!", fbaos.toString()); // clone ctor calls super ctor, fbaos.reset(); assertEquals("REPLACED VIRTUAL! jodd.proxetta.fixtures.inv.Two * one!173>overriden sub", fbaos.toString()); fbaos.reset(); "REPLACED STATIC! one * jodd/proxetta/fixtures/inv/Two * " + "example2 * void example2() * jodd.proxetta.fixtures.inv.One * " + "jodd.proxetta.fixtures.inv.One" + ProxettaNames.invokeProxyClassNameSuffix + "!15013static: 4", fbaos.toString()); fbaos.reset(); assertEquals("state = REPLACED ctor!", fbaos.toString()); fbaos.reset();
protected String readDataHeaderString(final String encoding) throws IOException { FastByteArrayOutputStream data = new FastByteArrayOutputStream(); byte b; while (true) { // end marker byte on offset +0 and +2 must be 13 if ((b = readByte()) != '\r') { data.write(b); continue; } mark(4); skipBytes(1); int i = read(); if (i == -1) { // reached end of stream return null; } if (i == '\r') { reset(); break; } reset(); data.write(b); } skipBytes(3); if (encoding != null) { return data.toString(encoding); } else { return data.toString(); } }