tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 
 Tools and Libs > Ostermiller Utilities > Base64 Encode Stream

Base64 Encode Stream 

Ostermiller Java Utilities contain various components such as CSV parsing, Base64 Encoding, MD5 digest, String and Exec Helper classes. This requires the library ostermillerutils-1.08.01.jar to be in classpath. The following example shows encoding an input stream in Base64 format.

File Name  :  
/OSTERMILLER_UTILS/abcd.txt 

File Name  :  
com/bethecoder/tutorials/ostermillerutils/Base64EncodeStreamTest.java 
Author  :  Sudhakar KV
Email  :  kvenkatasudhakar@gmail.com
   
package com.bethecoder.tutorials.ostermillerutils;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import com.Ostermiller.util.Base64;

public class Base64EncodeStreamTest {

  /**
   @param args
   @throws IOException 
   */
  public static void main(String[] argsthrows IOException {

    InputStream in = new FileInputStream("abcd.txt");
    OutputStream out = new FileOutputStream("abcd.enc_stream.txt");
    Base64.encode(in, out);
  }

}
   

It gives the following output,
File Name  :  
/OSTERMILLER_UTILS/abcd.enc_stream.txt 


                    Print

   



Books Recommendation

 
 
bl  br