samples/messagedigest/src-new-api/org/apidesign/spi/security/Digestor.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:58:11 +0200
changeset 154 0fd5e9c500b9
parent 153 b5cbb797ec0a
child 180 131332825eab
permissions -rw-r--r--
Merge: Geertjan's changs up to 2000
     1 /*
     2  * To change this template, choose Tools | Templates
     3  * and open the template in the editor.
     4  */
     5 
     6 package org.apidesign.spi.security;
     7 
     8 import java.nio.ByteBuffer;
     9 
    10 /**
    11  *
    12  * @author  Jaroslav Tulach <jaroslav.tulach@apidesign.org>
    13  */
    14 // BEGIN: day.end.bridges.Digestor
    15 public abstract class Digestor<Data> {
    16    protected abstract byte[] digest(Data data);
    17    protected abstract Data create(String algorithm); 
    18    protected abstract void update(Data data, ByteBuffer input);
    19    
    20 // FINISH: day.end.bridges.Digestor   
    21    
    22    
    23    static {
    24        // initializes the accessor, so the api package can call protected
    25        // methods from this class
    26        new DigestorAccessorImpl();
    27    }
    28 }
    29