CryptoPro JCP v 1.0.
Public API.

ru.CryptoPro.JCP.tools
Class Encoder

java.lang.Object
  extended byru.CryptoPro.JCP.tools.Encoder

public class Encoder
extends java.lang.Object

This class implements a BASE64 Character encoder as specified in RFC1521 and used for encode the certification request. This RFC is part of the MIME specification as published by the Internet Engineering Task Force (IETF). Unlike some other encoding schemes there is nothing in this encoding that indicates where a buffer starts or ends. This means that the encoded text will simply start with the first line of encoded text and end with the last line of encoded text.

Author:
Copyright 2004-2005 Crypto-Pro. All rights reserved.
Version:1.0

Constructor Summary
Encoder()
           
 
Method Summary
 java.lang.String encode(byte[] aBuffer)
          A 'streamless' version of encode that simply takes a buffer of bytes and returns a string containing the encoded buffer.
 void encode(byte[] aBuffer, java.io.OutputStream aStream)
          Encode the buffer in aBuffer and write the encoded result to the OutputStream aStream.
 void encode(java.io.InputStream inStream, java.io.OutputStream outStream)
          Encode bytes from the input stream, and write them as text characters to the output stream.
 java.lang.String encodeBuffer(byte[] aBuffer)
          A 'streamless' version of encode that simply takes a buffer of bytes and returns a string containing the encoded buffer.
 void encodeBuffer(byte[] aBuffer, java.io.OutputStream aStream)
          Encode the buffer in aBuffer and write the encoded result to the OutputStream aStream.
 void encodeBuffer(java.io.InputStream inStream, java.io.OutputStream outStream)
          Encode bytes from the input stream, and write them as text characters to the output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Encoder

public Encoder()
Method Detail

encode

public void encode(java.io.InputStream inStream,
                   java.io.OutputStream outStream)
            throws java.io.IOException
Encode bytes from the input stream, and write them as text characters to the output stream. This method will run until it exhausts the input stream, but does not print the line suffix for a final line that is shorter than bytesPerLine().

Throws:
java.io.IOException

encode

public void encode(byte[] aBuffer,
                   java.io.OutputStream aStream)
            throws java.io.IOException
Encode the buffer in aBuffer and write the encoded result to the OutputStream aStream.

Throws:
java.io.IOException

encode

public java.lang.String encode(byte[] aBuffer)
A 'streamless' version of encode that simply takes a buffer of bytes and returns a string containing the encoded buffer.


encodeBuffer

public void encodeBuffer(java.io.InputStream inStream,
                         java.io.OutputStream outStream)
                  throws java.io.IOException
Encode bytes from the input stream, and write them as text characters to the output stream. This method will run until it exhausts the input stream. It differs from encode in that it will add the line at the end of a final line that is shorter than bytesPerLine().

Throws:
java.io.IOException

encodeBuffer

public void encodeBuffer(byte[] aBuffer,
                         java.io.OutputStream aStream)
                  throws java.io.IOException
Encode the buffer in aBuffer and write the encoded result to the OutputStream aStream.

Throws:
java.io.IOException

encodeBuffer

public java.lang.String encodeBuffer(byte[] aBuffer)
A 'streamless' version of encode that simply takes a buffer of bytes and returns a string containing the encoded buffer.


Copyright Crypto-Pro.
All rights reserved.