Replacing StringBuffer with lock-free StringBuilder
Closes gh-5727
This commit is contained in:
committed by
Stephane Nicoll
parent
1da9e4d80a
commit
64989ae192
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user