commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject [commons-codec] branch master updated: [CODEC-272] Add RandomAccessFile digest methods #31.
Date Wed, 04 Dec 2019 23:38:49 GMT
This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-codec.git


The following commit(s) were added to refs/heads/master by this push:
     new a3a4edd  [CODEC-272] Add RandomAccessFile digest methods #31.
a3a4edd is described below

commit a3a4eddd3e6180385ca38efd9ff4965c07995e64
Author: Gary Gregory <gardgregory@gmail.com>
AuthorDate: Wed Dec 4 18:38:45 2019 -0500

    [CODEC-272] Add RandomAccessFile digest methods #31.
    
    - This is a slightly different version from
    https://github.com/apache/commons-codec/pull/31/
    - Refactor updateDigest(MessageDigest,RandomAccessFile) into an new
    private updateDigest(MessageDigest,FileChannel) as possible public
    candidate.
    - Do NOT seek to 0 on a RandomAccessFile before calling updateDigest():
    We do not do this for ByteBuffer input, so do not do it here and be
    consistent to assume that when the caller says 'digest this' then do it
    from where the input stands (like a stream).
    - Add methods in the file to keep methods in alphabetical order.
    - Closes #31.
---
 .../org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
b/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
index b31de83..d0bb626 100644
--- a/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
+++ b/src/test/java/org/apache/commons/codec/digest/MessageDigestAlgorithmsTest.java
@@ -167,7 +167,7 @@ public class MessageDigestAlgorithmsTest {
                         DigestUtils.getDigest(messageDigestAlgorithm), getTestRandomAccessFile()
                 )
         );
-
+        getTestRandomAccessFile().seek(0);
         Assert.assertArrayEquals(expected,
                 DigestUtils.digest(
                         DigestUtils.getDigest(messageDigestAlgorithm), getTestRandomAccessFile()


Mime
View raw message