301 byte[] buffer = new byte[1024];
302 int len;
303
304 try (BZip2CompressorInputStream in = new BZip2CompressorInputStream(new BufferedInputStream(new FileInputStream(tempFile))); FileOutputStream out = new FileOutputStream(output)) {305 while ((len = in.read(buffer)) != -1) {
306 out.write(buffer, 0, len);
307 bytesRead += len;
239 * @param downloadedFile The temp file's name that was downloaded.
240 */
241 private void decompress(String downloadedFile) {
242 try (FileInputStream fileInputStream = new FileInputStream(downloadedFile); BufferedInputStream bufferedInputStream = new BufferedInputStream(fileInputStream); GzipCompressorInputStream gzipInputStream = new GzipCompressorInputStream(bufferedInputStream); TarArchiveInputStream tarArchiveInputStream = new TarArchiveInputStream(gzipInputStream)) {243
244 TarArchiveEntry entry;
245 while ((entry = tarArchiveInputStream.getNextEntry()) != null) {
Multiple variables (or fields) should not be declared on the same line.
Declaring more than one variables (or fields) on the same line makes the code harder to read. Things might get more confusing if some of those variables are initiliazed and some of them are not.
class Klass {
private int a, b = 20;
private void method() {
double d1, d2 = 3.5, d3;
// ... rest of the code
}
}
Consider declaring one variable per line.
class Klass {
private int a;
private int b = 20;
private void method() {
double d1;
double d2 = 3.5;
double d3;
// ... rest of the code
}
}