Avoid temporary string in JSON reading

This commit is contained in:
Jason Zaugg 2018-10-09 15:44:06 +10:00 committed by Eugene Yokota
parent f16997d3a9
commit 65e2980e9d
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class PlainInput[J: IsoString](input: InputStream, converter: SupportConverter[J
val buffer = new Array[Char](bufferSize)
var read = 0
while ({ read = reader.read(buffer, 0, bufferSize); read != -1 }) {
builder.append(String.valueOf(buffer.take(read)))
builder.appendAll(buffer, 0, read)
}
builder.toString()
}