diff src/org/eclipse/jetty/http/HttpGenerator.java @ 1048:2b769da7f67d

remove Buffer
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 07 Nov 2016 23:15:42 -0700
parents a7319f14ba1e
children afc9610dc12e
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpGenerator.java	Mon Nov 07 22:51:09 2016 -0700
+++ b/src/org/eclipse/jetty/http/HttpGenerator.java	Mon Nov 07 23:15:42 2016 -0700
@@ -22,7 +22,7 @@
 import java.io.InterruptedIOException;
 import java.util.Arrays;
 
-import org.eclipse.jetty.io.Buffer;
+import org.eclipse.jetty.io.JBuffer;
 import org.eclipse.jetty.io.BufferUtil;
 import org.eclipse.jetty.io.Buffers;
 import org.eclipse.jetty.io.EndPoint;
@@ -126,12 +126,12 @@
 	 *
 	 * @param content
 	 * @param last
-	 * @throws IllegalArgumentException if <code>content</code> is {@link Buffer#isImmutable immutable}.
+	 * @throws IllegalArgumentException if <code>content</code> is {@link JBuffer#isImmutable immutable}.
 	 * @throws IllegalStateException If the request is not expecting any more content,
 	 *   or if the buffers are full and cannot be flushed.
 	 * @throws IOException if there is a problem flushing the buffers.
 	 */
-	public void addContent(Buffer content, boolean last) throws IOException
+	public void addContent(JBuffer content, boolean last) throws IOException
 	{
 		if (_noContent)
 			throw new IllegalStateException("NO CONTENT");
@@ -154,7 +154,7 @@
 			{
 				if (_bufferChunked)
 				{
-					Buffer nc = _buffers.getBuffer(_content.remaining()+CHUNK_SPACE+content.remaining());
+					JBuffer nc = _buffers.getBuffer(_content.remaining()+CHUNK_SPACE+content.remaining());
 					nc.put(_content);
 					nc.put(HttpTokens.CRLF);
 					BufferUtil.putHexInt(nc, content.remaining());
@@ -164,7 +164,7 @@
 				}
 				else
 				{
-					Buffer nc = _buffers.getBuffer(_content.remaining()+content.remaining());
+					JBuffer nc = _buffers.getBuffer(_content.remaining()+content.remaining());
 					nc.put(_content);
 					nc.put(content);
 					content=nc;
@@ -214,7 +214,7 @@
 			return -1;
 
 		// Handle any unfinished business?
-		Buffer content = _content;
+		JBuffer content = _content;
 		if (content != null && content.remaining()>0 || _bufferChunked)
 		{
 			flushBuffer();
@@ -983,9 +983,9 @@
 	@Override
 	public String toString()
 	{
-		Buffer header=_header;
-		Buffer buffer=_buffer;
-		Buffer content=_content;
+		JBuffer header=_header;
+		JBuffer buffer=_buffer;
+		JBuffer content=_content;
 		return String.format("%s{s=%d,h=%d,b=%d,c=%d}",
 				getClass().getSimpleName(),
 				_state,