mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user