diff src/org/eclipse/jetty/server/AbstractHttpConnection.java @ 1046:a8c92b0a08ed

add JBuffer
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 07 Nov 2016 22:39:39 -0700
parents b71ad168fe34
children 2b769da7f67d
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Sun Nov 06 14:54:43 2016 -0700
+++ b/src/org/eclipse/jetty/server/AbstractHttpConnection.java	Mon Nov 07 22:39:39 2016 -0700
@@ -42,7 +42,7 @@
 import org.eclipse.jetty.io.AbstractConnection;
 import org.eclipse.jetty.io.Buffer;
 import org.eclipse.jetty.io.Buffers;
-import org.eclipse.jetty.io.ByteArrayBuffer;
+import org.eclipse.jetty.io.BufferUtil;
 import org.eclipse.jetty.io.EndPoint;
 import org.eclipse.jetty.io.EofException;
 import org.eclipse.jetty.io.RuntimeIOException;
@@ -704,7 +704,7 @@
 	public final class Output extends ServletOutputStream
 	{
 		private boolean _closed;
-		private ByteArrayBuffer _onebyte;
+		private Buffer _onebyte;
 		
 		// These are held here for reuse by Writer
 		String _characterEncoding;
@@ -720,20 +720,20 @@
 		@Override
 		public final void write(byte[] b, int off, int len) throws IOException
 		{
-			write(new ByteArrayBuffer(b,off,len));
+			write(BufferUtil.wrap(b,off,len));
 		}
 	
 		@Override
 		public final void write(byte[] b) throws IOException
 		{
-			write(new ByteArrayBuffer(b));
+			write(BufferUtil.wrap(b));
 		}
 	
 		@Override
 		public final void write(int b) throws IOException
 		{
 			if (_onebyte==null)
-				_onebyte = new ByteArrayBuffer(1);
+				_onebyte = BufferUtil.newBuffer(1);
 			else
 				_onebyte.clear();
 			_onebyte.put((byte)b);