Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


com.tangosol.net.security
Class BlockCipherOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by com.tangosol.net.security.BlockCipherOutputStream

All Implemented Interfaces:
java.io.Closeable, java.io.Flushable

public class BlockCipherOutputStream
extends java.io.FilterOutputStream

InputStream which supports block ciphers, and data sizes which exceed the Cipher's block size.

Author:
mf 2006.08.08

Field Summary
protected  byte[] m_abBlockClear
          The current block of unencrypted data
protected  javax.crypto.Cipher m_cipher
          The Encryption Cipher
protected  int m_nBlockIndex
          The next available index to write into the unencrypted data block.

 

Fields inherited from class java.io.FilterOutputStream
out

 

Constructor Summary
BlockCipherOutputStream(java.io.OutputStream stream, javax.crypto.Cipher cipher)
          Construct a BlockCipherOutputStream around the supplied stream and encrypt output data with the supplied cipher.
BlockCipherOutputStream(java.io.OutputStream stream, javax.crypto.Cipher cipher, int cbBlock)
          Construct a BlockCipherOutputStream around the supplied stream and encrypt output data with the supplied cipher.

 

Method Summary
 void flush()
          
 void write(byte[] abData, int nOffset, int nLength)
          
 void write(int bData)
          
protected  void writeBlock()
          Write the current clear block to the wrapped stream.

 

Methods inherited from class java.io.FilterOutputStream
close, write

 

Field Detail

m_cipher

protected javax.crypto.Cipher m_cipher
The Encryption Cipher

m_abBlockClear

protected byte[] m_abBlockClear
The current block of unencrypted data

m_nBlockIndex

protected int m_nBlockIndex
The next available index to write into the unencrypted data block.

Constructor Detail

BlockCipherOutputStream

public BlockCipherOutputStream(java.io.OutputStream stream,
                               javax.crypto.Cipher cipher)
Construct a BlockCipherOutputStream around the supplied stream and encrypt output data with the supplied cipher.
Parameters:
stream - the stream to write encrypted data to
cipher - the cipher to use to encrypt data

BlockCipherOutputStream

public BlockCipherOutputStream(java.io.OutputStream stream,
                               javax.crypto.Cipher cipher,
                               int cbBlock)
Construct a BlockCipherOutputStream around the supplied stream and encrypt output data with the supplied cipher.
Parameters:
stream - the stream to write encrypted data to
cipher - the cipher to use to encrypt data
cbBlock - the size of an unencrypted block required by the cipher

Method Detail

flush

public void flush()
           throws java.io.IOException
Specified by:
flush in interface java.io.Flushable
Overrides:
flush in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(int bData)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

write

public void write(byte[] abData,
                  int nOffset,
                  int nLength)
           throws java.io.IOException
Overrides:
write in class java.io.FilterOutputStream
Throws:
java.io.IOException

writeBlock

protected void writeBlock()
                   throws java.io.IOException
Write the current clear block to the wrapped stream.
Throws:
java.io.IOException

Skip navigation links

Oracle® Coherence Java API Reference
Release 3.7.0.0

E18683-01


Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.