5757 */
5858public class DigestUtils {
5959
60- private static final int STREAM_BUFFER_LENGTH = 1024 ;
60+ private static final int BUFFER_SIZE = 1024 ;
6161
6262 /**
6363 * Reads through a byte array and returns the digest for the data. Provided for symmetry with other methods.
@@ -1291,7 +1291,7 @@ public static MessageDigest updateDigest(final MessageDigest digest, final File
12911291 * @since 1.14
12921292 */
12931293 private static MessageDigest updateDigest (final MessageDigest digest , final FileChannel data ) throws IOException {
1294- final ByteBuffer buffer = ByteBuffer .allocate (STREAM_BUFFER_LENGTH );
1294+ final ByteBuffer buffer = ByteBuffer .allocate (BUFFER_SIZE );
12951295 while (data .read (buffer ) > 0 ) {
12961296 buffer .flip ();
12971297 digest .update (buffer );
@@ -1310,12 +1310,12 @@ private static MessageDigest updateDigest(final MessageDigest digest, final File
13101310 * @since 1.8
13111311 */
13121312 public static MessageDigest updateDigest (final MessageDigest digest , final InputStream inputStream ) throws IOException {
1313- final byte [] buffer = new byte [STREAM_BUFFER_LENGTH ];
1314- int read = inputStream .read (buffer , 0 , STREAM_BUFFER_LENGTH );
1313+ final byte [] buffer = new byte [BUFFER_SIZE ];
1314+ int read = inputStream .read (buffer , 0 , BUFFER_SIZE );
13151315
13161316 while (read > -1 ) {
13171317 digest .update (buffer , 0 , read );
1318- read = inputStream .read (buffer , 0 , STREAM_BUFFER_LENGTH );
1318+ read = inputStream .read (buffer , 0 , BUFFER_SIZE );
13191319 }
13201320
13211321 return digest ;
0 commit comments