diff src/org/eclipse/jetty/io/BufferUtil.java @ 1054:87275900646e

remove JBuffer.toString()
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 08 Nov 2016 01:03:02 -0700
parents 4a2489f1d5fe
children e6ca3cb52837
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/BufferUtil.java	Tue Nov 08 00:32:02 2016 -0700
+++ b/src/org/eclipse/jetty/io/BufferUtil.java	Tue Nov 08 01:03:02 2016 -0700
@@ -19,6 +19,7 @@
 package org.eclipse.jetty.io;
 
 import java.nio.ByteBuffer;
+import java.nio.charset.Charset;
 import org.eclipse.jetty.util.StringUtil;
 
 
@@ -305,4 +306,13 @@
 		return new JBuffer(bb);
 	}
 
+
+
+	private static final Charset ISO_8859_1 = Charset.forName("ISO-8859-1");
+
+	public static String getString(JBuffer buffer) {
+		byte[] bytes = new byte[buffer.remaining()];
+		buffer.get(bytes);
+		return new String(bytes,ISO_8859_1);
+	}
 }