+ /**
+ * Display a DEBUG {@link String} representation of this object.
+ * <p>
+ * Do <b>not</b> use for release code.
+ */
+ @Override
+ public String toString() {
+ String data = "";
+ if (stop > 0) {
+ try {
+ data = new String(Arrays.copyOfRange(buffer, 0, stop), "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ }
+ if (data.length() > 200) {
+ data = data.substring(0, 197) + "...";
+ }
+ }