diff src/org/eclipse/jetty/io/BufferUtil.java @ 1048:2b769da7f67d

remove Buffer
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 07 Nov 2016 23:15:42 -0700
parents a8c92b0a08ed
children 4a2489f1d5fe
line wrap: on
line diff
--- a/src/org/eclipse/jetty/io/BufferUtil.java	Mon Nov 07 22:51:09 2016 -0700
+++ b/src/org/eclipse/jetty/io/BufferUtil.java	Mon Nov 07 23:15:42 2016 -0700
@@ -19,7 +19,6 @@
 package org.eclipse.jetty.io;
 
 import java.nio.ByteBuffer;
-import org.eclipse.jetty.io.nio.NIOBuffer;
 import org.eclipse.jetty.util.StringUtil;
 
 
@@ -42,7 +41,7 @@
 	 * @param buffer A buffer containing an integer. The position is not changed.
 	 * @return an int 
 	 */
-	public static int toInt(Buffer buffer)
+	public static int toInt(JBuffer buffer)
 	{
 		int val= 0;
 		boolean started= false;
@@ -109,7 +108,7 @@
 		throw new NumberFormatException(s);
 	}
 
-	public static void putHexInt(Buffer buffer, int n)
+	public static void putHexInt(JBuffer buffer, int n)
 	{
 
 		if (n < 0)
@@ -163,7 +162,7 @@
 	 * @param buffer
 	 * @param n
 	 */
-	public static void prependHexInt(Buffer buffer, int n)
+	public static void prependHexInt(JBuffer buffer, int n)
 	{
 		if (n==0)
 		{
@@ -195,7 +194,7 @@
 	}
 	
 
-	public static void putDecLong(Buffer buffer, long n)
+	public static void putDecLong(JBuffer buffer, long n)
 	{
 		if (n < 0)
 		{
@@ -271,36 +270,36 @@
 	};
 
 
-	public static void putCRLF(Buffer buffer)
+	public static void putCRLF(JBuffer buffer)
 	{
 		buffer.put((byte)13);
 		buffer.put((byte)10);
 	}
 
 
-	public static final NIOBuffer EMPTY_BUFFER = new JBuffer(ByteBuffer.allocate(0));
+	public static final JBuffer EMPTY_BUFFER = new JBuffer(ByteBuffer.allocate(0));
 
-	public static NIOBuffer wrap(byte[] array,int offset,int length) {
+	public static JBuffer wrap(byte[] array,int offset,int length) {
 		return new JBuffer(ByteBuffer.wrap(array,offset,length));
 	}
 
-	public static NIOBuffer wrap(byte[] array) {
+	public static JBuffer wrap(byte[] array) {
 		return new JBuffer(ByteBuffer.wrap(array));
 	}
 
-	public static NIOBuffer wrap(String s) {
+	public static JBuffer wrap(String s) {
 		byte[] bytes = StringUtil.getBytes(s);
 		ByteBuffer bb = ByteBuffer.wrap(bytes).asReadOnlyBuffer();
 		return new JBuffer(bb);
 	}
 
-	public static NIOBuffer newBuffer(int size) {
+	public static JBuffer newBuffer(int size) {
 		ByteBuffer bb = ByteBuffer.allocate(size);
 		bb.limit(0);
 		return new JBuffer(bb);
 	}
 
-	public static NIOBuffer newDirectBuffer(int size) {
+	public static JBuffer newDirectBuffer(int size) {
 		ByteBuffer bb = ByteBuffer.allocateDirect(size);
 		bb.limit(0);
 		return new JBuffer(bb);