samples/messagedigest/src/api/Digest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:51:46 +0200
changeset 38 8f9ed9c4a97b
parent 37 1b1a4a203bf2
child 39 d4dd8d7df7a2
permissions -rw-r--r--
spi part
     1 
     2 package api;
     3 
     4 import java.nio.ByteBuffer;
     5 import spi.DigestImplementation;
     6 
     7 /** MessageDigest extends MessageDigestSpi, that means the javadoc
     8  *
     9  * @author Jaroslav Tulach
    10  */
    11 public final class Digest {
    12     private final DigestImplementation impl;
    13 
    14     /** Factory method is better than constructor */
    15     private Digest(DigestImplementation impl) {
    16         this.impl = impl;
    17     }
    18     
    19     /** Factory method to create digest for an algorithm.
    20      */
    21     public static Digest getInstance(String algorithm) {
    22         return null;
    23     }
    24       
    25     //
    26     // these methods are kept the same as in original MessageDigest,
    27     // but for simplicity choose just some from the original API
    28     //
    29     
    30     public byte[] digest(ByteBuffer bb) {
    31         return null;
    32     }
    33             
    34 }