FastByteArrayOutputStream.read byte-to-int conversion
Issue: SPR-17492
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2017 the original author or authors.
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -367,7 +367,7 @@ public class FastByteArrayOutputStream extends OutputStream {
|
||||
else {
|
||||
if (this.nextIndexInCurrentBuffer < this.currentBufferLength) {
|
||||
this.totalBytesRead++;
|
||||
return this.currentBuffer[this.nextIndexInCurrentBuffer++];
|
||||
return this.currentBuffer[this.nextIndexInCurrentBuffer++] & 0xFF;
|
||||
}
|
||||
else {
|
||||
if (this.buffersIterator.hasNext()) {
|
||||
@@ -487,7 +487,7 @@ public class FastByteArrayOutputStream extends OutputStream {
|
||||
|
||||
/**
|
||||
* Update the message digest with the remaining bytes in this stream.
|
||||
* @param messageDigest The message digest to update
|
||||
* @param messageDigest the message digest to update
|
||||
*/
|
||||
@Override
|
||||
public void updateMessageDigest(MessageDigest messageDigest) {
|
||||
@@ -497,7 +497,7 @@ public class FastByteArrayOutputStream extends OutputStream {
|
||||
/**
|
||||
* Update the message digest with the next len bytes in this stream.
|
||||
* Avoids creating new byte arrays and use internal buffers for performance.
|
||||
* @param messageDigest The message digest to update
|
||||
* @param messageDigest the message digest to update
|
||||
* @param len how many bytes to read from this stream and use to update the message digest
|
||||
*/
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user