Commit a688613f authored by Stephane Nicoll's avatar Stephane Nicoll

Merge branch '1.5.x'

parents 813a6966 37d229b1
......@@ -209,7 +209,7 @@ class JsonReader {
StringBuilder out = new StringBuilder();
InputStreamReader reader = new InputStreamReader(in, charset);
char[] buffer = new char[BUFFER_SIZE];
int bytesRead = -1;
int bytesRead;
while ((bytesRead = reader.read(buffer)) != -1) {
out.append(buffer, 0, bytesRead);
}
......
......@@ -86,7 +86,7 @@ public class DefaultLaunchScript implements LaunchScript {
private void copy(InputStream inputStream, OutputStream outputStream)
throws IOException {
byte[] buffer = new byte[BUFFER_SIZE];
int bytesRead = -1;
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
......
......@@ -300,7 +300,7 @@ public class JarWriter implements LoaderClassesWriter, AutoCloseable {
@Override
public void write(OutputStream outputStream) throws IOException {
byte[] buffer = new byte[BUFFER_SIZE];
int bytesRead = -1;
int bytesRead;
while ((bytesRead = this.inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
......@@ -383,7 +383,7 @@ public class JarWriter implements LoaderClassesWriter, AutoCloseable {
private void load(InputStream inputStream) throws IOException {
byte[] buffer = new byte[BUFFER_SIZE];
int bytesRead = -1;
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
this.crc.update(buffer, 0, bytesRead);
this.size += bytesRead;
......
......@@ -95,7 +95,7 @@ public class TestJarFile {
}
private void copy(InputStream in, OutputStream out) throws IOException {
int bytesRead = -1;
int bytesRead;
while ((bytesRead = in.read(this.buffer)) != -1) {
out.write(this.buffer, 0, bytesRead);
}
......
......@@ -149,7 +149,7 @@ public class JarFileArchive implements Archive {
ResourceAccess.ONCE);
OutputStream outputStream = new FileOutputStream(file)) {
byte[] buffer = new byte[BUFFER_SIZE];
int bytesRead = -1;
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment