samples/messagedigest/src-new-api/org/apidesign/spi/security/DigestorAccessorImpl.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:59:27 +0200
changeset 181 81d72f69fa42
permissions -rw-r--r--
Incorporating Patrick's changes. I am not reall sure about the changes after the war, it is really 'or' it cannot be 'and'. I will change that when I do the reading through the whole chapter.
     1 package org.apidesign.spi.security;
     2 
     3 import java.nio.ByteBuffer;
     4 import org.apidesign.impl.DigestorAccessor;
     5 
     6 /**
     7  *
     8  * @author  Jaroslav Tulach <jaroslav.tulach@apidesign.org>
     9  */
    10 final class DigestorAccessorImpl extends DigestorAccessor {
    11     @Override
    12     public <Data> byte[] digest(Digestor<Data> dig, Data data) {
    13         return dig.digest(data);
    14     }
    15 
    16     @Override
    17     public <Data> Data create(Digestor<Data> dig, String algorithm) {
    18         return dig.create(algorithm);
    19     }
    20 
    21     @Override
    22     public <Data> void update(Digestor<Data> dig, Data data, ByteBuffer input) {
    23         dig.update(data, input);
    24     }
    25 }