diff src/org/eclipse/jetty/http/HttpGenerator.java @ 1039:a7319f14ba1e

remove Buffer.isImmutable()
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 03 Nov 2016 22:55:28 -0600
parents b71ad168fe34
children 2b769da7f67d
line wrap: on
line diff
--- a/src/org/eclipse/jetty/http/HttpGenerator.java	Thu Nov 03 22:16:11 2016 -0600
+++ b/src/org/eclipse/jetty/http/HttpGenerator.java	Thu Nov 03 22:55:28 2016 -0600
@@ -20,11 +20,11 @@
 
 import java.io.IOException;
 import java.io.InterruptedIOException;
+import java.util.Arrays;
 
 import org.eclipse.jetty.io.Buffer;
 import org.eclipse.jetty.io.BufferUtil;
 import org.eclipse.jetty.io.Buffers;
-import org.eclipse.jetty.io.ByteArrayBuffer;
 import org.eclipse.jetty.io.EndPoint;
 import org.eclipse.jetty.io.EofException;
 import org.eclipse.jetty.util.StringUtil;
@@ -46,8 +46,8 @@
 	// Build cache of response lines for status
 	private static class Status
 	{
-		Buffer _schemeCode;
-		Buffer _responseLine;
+		byte[] _schemeCode;
+		byte[] _responseLine;
 	}
 	private static final Status[] __status = new Status[HttpStatus.MAX_CODE+1];
 	static
@@ -74,8 +74,8 @@
 			bytes[versionLength+6+reason.length()]=HttpTokens.LINE_FEED;
 
 			__status[i] = new Status();
-			__status[i]._schemeCode=new ByteArrayBuffer(bytes,0,versionLength+5,Buffer.IMMUTABLE);
-			__status[i]._responseLine=new ByteArrayBuffer(bytes,0,bytes.length,Buffer.IMMUTABLE);
+			__status[i]._schemeCode = Arrays.copyOf(bytes,versionLength+5);
+			__status[i]._responseLine = bytes;
 		}
 	}