Replacing StringBuffer with lock-free StringBuilder

Closes gh-5727
This commit is contained in:
Jakub Narloch
2016-04-18 21:43:29 +02:00
committed by Stephane Nicoll
parent 1da9e4d80a
commit 64989ae192
6 changed files with 19 additions and 18 deletions

View File

@@ -44,7 +44,7 @@ class ConnectionInputStream extends FilterInputStream {
*/
public String readHeader() throws IOException {
byte[] buffer = new byte[BUFFER_SIZE];
StringBuffer content = new StringBuffer(BUFFER_SIZE);
StringBuilder content = new StringBuilder(BUFFER_SIZE);
while (content.indexOf(HEADER_END) == -1) {
int amountRead = checkedRead(buffer, 0, BUFFER_SIZE);
content.append(new String(buffer, 0, amountRead));