Skip to content
Permalink
Browse files

Increase byte buffer to 8kb. Resolves #65

  • Loading branch information...
mordechai
mordechai committed Apr 8, 2019
1 parent 5edc494 commit 8cf0f5e02758eee7f1d447492d4bd758f84f6dcd
Showing with 6 additions and 4 deletions.
  1. +3 −1 CHANGELOG.md
  2. +1 −1 src/main/java/org/update4j/ConfigImpl.java
  3. +2 −2 src/main/java/org/update4j/util/FileUtils.java
@@ -1,4 +1,6 @@
* *Upcoming Release*
* Increased download byte buffer to 8kb *— suggested by [@ChristianCiach](https://github.com/ChristianCiach)*
* **1.4.1**
* Allow 2 files with same path in config if both target different operating systems.
* Added `UpdateHandler.shouldCheckForUpdate()`. Returning `false` will skip that file from being updated.
* Pass arguments and system properties from the config when using the `DefaultLauncher`.
@@ -23,7 +25,7 @@
* Renamed `UpdateHandler::connect` to `UpdateHandler::openDownloadStream`
* Added more `Configuration.Builder::signer` overloads.
* Default bootstrap now deletes old files if `--syncLocal` was used.
* **1.3.2** *— h/t [@ChristianCiach](https://github.com/ChristianCiach)*
* **1.3.2** *— Tested on Linux by [@ChristianCiach](https://github.com/ChristianCiach)*
* Control how files are downloaded with `UpdateHandler::connect`.
* Delete old files with `Configuration::deleteOldFiles`.
* **1.3.1**
@@ -124,7 +124,7 @@ static boolean doUpdate(Configuration config, Path tempDir, PublicKey key, Injec

int read = 0;
double currentCompleted = 0;
byte[] buffer = new byte[1024];
byte[] buffer = new byte[1024 * 8];

Path output;
if (!updateTemp) {
@@ -51,7 +51,7 @@ private FileUtils() {
public static long getChecksum(Path path) throws IOException {
try (InputStream input = Files.newInputStream(path)) {
Adler32 checksum = new Adler32();
byte[] buf = new byte[1024];
byte[] buf = new byte[1024 * 8];

int read;
while ((read = input.read(buf, 0, buf.length)) > -1)
@@ -98,7 +98,7 @@ public static boolean isZipFile(Path path) throws IOException {
sign.initSign(key);

try (InputStream input = Files.newInputStream(path)) {
byte[] buf = new byte[1024];
byte[] buf = new byte[1024 * 8];
int len;
while ((len = input.read(buf, 0, buf.length)) > 0)
sign.update(buf, 0, len);

0 comments on commit 8cf0f5e

Please sign in to comment.
You can’t perform that action at this time.