org.jcp.xml.dsig.internal

Class DigesterOutputStream

  • java.lang.Object
    • java.io.OutputStream
      • org.jcp.xml.dsig.internal.DigesterOutputStream
  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable


    public class DigesterOutputStream
    extends java.io.OutputStream
    This class has been modified slightly to use java.security.MessageDigest objects as input, rather than com.sun.org.apache.xml.internal.security.algorithms.MessageDigestAlgorithm objects. It also optionally caches the input bytes.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DigesterOutputStream(java.security.MessageDigest md)
      Creates a DigesterOutputStream.
      DigesterOutputStream(java.security.MessageDigest md, boolean buffer)
      Creates a DigesterOutputStream.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void close() 
      byte[] getDigestValue() 
      java.io.InputStream getInputStream() 
      void write(byte[] input, int offset, int len) 
      void write(int input) 
      • Methods inherited from class java.io.OutputStream

        flush, write
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DigesterOutputStream

        public DigesterOutputStream(java.security.MessageDigest md)
        Creates a DigesterOutputStream.
        Parameters:
        md - the MessageDigest
      • DigesterOutputStream

        public DigesterOutputStream(java.security.MessageDigest md,
                            boolean buffer)
        Creates a DigesterOutputStream.
        Parameters:
        md - the MessageDigest
        buffer - if true, caches the input bytes
    • Method Detail

      • write

        public void write(int input)
        Specified by:
        write in class java.io.OutputStream
      • write

        public void write(byte[] input,
                 int offset,
                 int len)
        Overrides:
        write in class java.io.OutputStream
      • getDigestValue

        public byte[] getDigestValue()
        Returns:
        the digest value
      • getInputStream

        public java.io.InputStream getInputStream()
        Returns:
        an input stream containing the cached bytes, or null if not cached
      • close

        public void close()
                   throws java.io.IOException
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class java.io.OutputStream
        Throws:
        java.io.IOException

© Portions Copyright 2003, 2014 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.