From 775ba3f258186ce6f98397997c54780eeb5efba2 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 8 Oct 2018 15:43:15 +0200 Subject: [PATCH] cleanup --- .../credential-store/src/kdbx/HashedBlockInputStream.java | 6 +++--- .../src/kdbx/HashedBlockOutputStream.java | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/platform/credential-store/src/kdbx/HashedBlockInputStream.java b/platform/credential-store/src/kdbx/HashedBlockInputStream.java index 7706f1e67589..aab8f1d3ad54 100644 --- a/platform/credential-store/src/kdbx/HashedBlockInputStream.java +++ b/platform/credential-store/src/kdbx/HashedBlockInputStream.java @@ -45,7 +45,7 @@ import java.util.Arrays; * * @author Jo */ -public class HashedBlockInputStream extends InputStream { +final class HashedBlockInputStream extends InputStream { private static final int HASH_SIZE = 32; @SuppressWarnings("MismatchedReadAndWriteOfArray") private static final byte[] ZERO_HASH = new byte[HASH_SIZE]; @@ -57,7 +57,7 @@ public class HashedBlockInputStream extends InputStream { private final MessageDigest md = KdbxHeaderKt.sha256MessageDigest(); - public HashedBlockInputStream(InputStream inputStream) { + HashedBlockInputStream(@NotNull InputStream inputStream) { this.inputStream = inputStream; } @@ -89,7 +89,7 @@ public class HashedBlockInputStream extends InputStream { * @return the number of bytes actually returned, , -1 if end of file * @throws IOException */ - protected int get(byte[] b, int offset, int length) throws IOException { + private int get(byte[] b, int offset, int length) throws IOException { if (done) { return -1; } diff --git a/platform/credential-store/src/kdbx/HashedBlockOutputStream.java b/platform/credential-store/src/kdbx/HashedBlockOutputStream.java index 3f9e75c4846f..3badd71f5116 100644 --- a/platform/credential-store/src/kdbx/HashedBlockOutputStream.java +++ b/platform/credential-store/src/kdbx/HashedBlockOutputStream.java @@ -43,7 +43,7 @@ import java.security.MessageDigest; * * @author Jo */ -public class HashedBlockOutputStream extends OutputStream { +final class HashedBlockOutputStream extends OutputStream { private static final int BLOCK_SIZE = 8 * 1024; private static final int HASH_SIZE = 32; private static final byte[] ZERO_HASH = new byte[HASH_SIZE]; @@ -55,7 +55,7 @@ public class HashedBlockOutputStream extends OutputStream { private final MessageDigest md = KdbxHeaderKt.sha256MessageDigest(); - public HashedBlockOutputStream(OutputStream outputStream) { + HashedBlockOutputStream(OutputStream outputStream) { this.outputStream = outputStream; } @@ -100,7 +100,7 @@ public class HashedBlockOutputStream extends OutputStream { * @param length number of bytes to write * @throws IOException */ - protected void put(byte[] b, int offset, int length) throws IOException { + private void put(byte[] b, int offset, int length) throws IOException { if (isClosed) { throw new EOFException(); } @@ -118,7 +118,7 @@ public class HashedBlockOutputStream extends OutputStream { /** * Save the internal buffer to the underlying stream as a hash block */ - protected void save() throws IOException { + private void save() throws IOException { // if there's nothing to save don't do anything if (blockOutputStream.size() == 0) { return;