Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Beta3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.modeshape.common.util
Class SecureHash.HashingInputStream

    java.lang.Object
      java.io.InputStream
          org.modeshape.common.util.SecureHash.HashingInputStream

All Implemented Interfaces:
  Closeable

Enclosing class:
  SecureHash

    public static class SecureHash.HashingInputStream

extends InputStream

Constructor Summary
`protected` | `SecureHash.HashingInputStream(MessageDigest digest, InputStream input)`

Method Summary
`void` | `close()`
`byte[]` | `getHash()` Get the hash of the content read by this stream.
`String` | `getHashAsHexString()` Get the string representation of the binary hash of the content read by this stream.
`int` | `read()`
`int` | `read(byte[] b)`
`int` | `read(byte[] b, int off, int len)`

Methods inherited from class java.io.InputStream
`available, mark, markSupported, reset, skip`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SecureHash.HashingInputStream

    protected SecureHash.HashingInputStream(MessageDigest digest,
                                            InputStream input)

Method Detail

### read

    public int read()
             throws IOException

  Specified by:
    `read` in class `InputStream`
  Throws:
    `IOException`
  See Also:
    `InputStream.read()`

### read

    public int read(byte[] b,
                    int off,
                    int len)
             throws IOException

  Overrides:
    `read` in class `InputStream`
  Throws:
    `IOException`
  See Also:
    `InputStream.read(byte[], int, int)`

### read

    public int read(byte[] b)
             throws IOException

  Overrides:
    `read` in class `InputStream`
  Throws:
    `IOException`
  See Also:
    `InputStream.read(byte[])`

### close

    public void close()
               throws IOException

  Specified by:
    `close` in interface `Closeable`
  Overrides:
    `close` in class `InputStream`
  Throws:
    `IOException`
  See Also:
    `InputStream.close()`

### getHash

    public byte[] getHash()

  Get the hash of the content read by this stream. This method will return null if the stream has not yet been closed.

  Returns:
    the hash of the contents as a byte array, or null if the stream has not yet been closed

### getHashAsHexString

    public String getHashAsHexString()

  Get the string representation of the binary hash of the content read by this stream. This method will return null if the stream has not yet been closed.

  Returns:
    the hex-encoded representation of the binary hash of the contents, or null if the stream has not yet been closed

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| ModeShape Distribution 3.0.0.Beta3
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2008-2012 JBoss, a division of Red Hat. All Rights Reserved.