1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/samples/messagedigest/src-new-api/org/apidesign/spi/security/Digestor.java Sat Jun 14 09:52:25 2008 +0200
1.3 @@ -0,0 +1,29 @@
1.4 +/*
1.5 + * To change this template, choose Tools | Templates
1.6 + * and open the template in the editor.
1.7 + */
1.8 +
1.9 +package org.apidesign.spi.security;
1.10 +
1.11 +import java.nio.ByteBuffer;
1.12 +
1.13 +/**
1.14 + *
1.15 + * @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
1.16 + */
1.17 +// BEGIN: day.end.bridges.Digestor
1.18 +public abstract class Digestor<Data> {
1.19 + protected abstract byte[] digest(Data data);
1.20 + protected abstract Data create(String algorithm);
1.21 + protected abstract void update(Data data, ByteBuffer input);
1.22 +
1.23 +// END: day.end.bridges.Digestor
1.24 +
1.25 +
1.26 + static {
1.27 + // initializes the accessor, so the api package can call protected
1.28 + // methods from this class
1.29 + new DigestorAccessorImpl();
1.30 + }
1.31 +}
1.32 +