* Сергей Цыпанов: > @@ -105,12 +105,8 @@ > private byte[] getBytes(InputStream is) > throws IOException > { > - byte[] buffer = new byte[8192]; > ByteArrayOutputStream baos = new ByteArrayOutputStream(2048); > - int n; > - while ((n = is.read(buffer, 0, buffer.length)) != -1) { > - baos.write(buffer, 0, n); > - } > + is.transferTo(baos); > return baos.toByteArray(); > }
Isn't this InputStream::readAllBytes? Thanks, Florian