Merge pull request #187 from eed3si9n/fport/avoid-temp-string

Avoid temporary string in JSON reading
This commit is contained in:
eugene yokota 2018-10-09 18:50:20 -04:00 committed by GitHub
commit cd679591d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()
}