Switch to two-space indentation, remove inline comments.
This commit is contained in:
parent
adfa3c1b10
commit
4931d7327b
1 changed files with 15 additions and 17 deletions
|
@ -125,23 +125,22 @@ public class DecryptingPartInputStream extends FileInputStream {
|
||||||
|
|
||||||
private int readIncremental(byte[] buffer, int offset, int length) throws IOException {
|
private int readIncremental(byte[] buffer, int offset, int length) throws IOException {
|
||||||
int readLength = 0;
|
int readLength = 0;
|
||||||
//Use data from overflow buffer first if present
|
|
||||||
if (null != overflowBuffer) {
|
if (null != overflowBuffer) {
|
||||||
if (overflowBuffer.length > length) {
|
if (overflowBuffer.length > length) {
|
||||||
System.arraycopy(overflowBuffer, 0, buffer, offset, length);
|
System.arraycopy(overflowBuffer, 0, buffer, offset, length);
|
||||||
overflowBuffer = Arrays.copyOfRange(overflowBuffer, length, overflowBuffer.length);
|
overflowBuffer = Arrays.copyOfRange(overflowBuffer, length, overflowBuffer.length);
|
||||||
return length;
|
return length;
|
||||||
} else if (overflowBuffer.length == length) {
|
} else if (overflowBuffer.length == length) {
|
||||||
System.arraycopy(overflowBuffer, 0, buffer, offset, length);
|
System.arraycopy(overflowBuffer, 0, buffer, offset, length);
|
||||||
overflowBuffer = null;
|
overflowBuffer = null;
|
||||||
return length;
|
return length;
|
||||||
} else {
|
} else {
|
||||||
System.arraycopy(overflowBuffer, 0, buffer, offset, overflowBuffer.length);
|
System.arraycopy(overflowBuffer, 0, buffer, offset, overflowBuffer.length);
|
||||||
readLength += overflowBuffer.length;
|
readLength += overflowBuffer.length;
|
||||||
offset += readLength;
|
offset += readLength;
|
||||||
length -= readLength;
|
length -= readLength;
|
||||||
overflowBuffer = null;
|
overflowBuffer = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (length + totalRead > totalDataSize)
|
if (length + totalRead > totalDataSize)
|
||||||
|
@ -154,7 +153,6 @@ public class DecryptingPartInputStream extends FileInputStream {
|
||||||
try {
|
try {
|
||||||
mac.update(internalBuffer, 0, read);
|
mac.update(internalBuffer, 0, read);
|
||||||
|
|
||||||
//data retrieved using cipher.update doesn't always match cipher.getOutputSize (but should never be larger)
|
|
||||||
int outputLen = cipher.getOutputSize(read);
|
int outputLen = cipher.getOutputSize(read);
|
||||||
|
|
||||||
if (outputLen <= length) {
|
if (outputLen <= length) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue