net.sourceforge.groboutils.util.io.v1
Class MimeOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byjava.io.FilterOutputStream
          extended bynet.sourceforge.groboutils.util.io.v1.MimeOutputStream

public class MimeOutputStream
extends java.io.FilterOutputStream

java.io.FilterOutputStream implementation for Mime base 64. Not incredibly efficient, but it works and is small.

All we need to implement are:

Since:
0.9.0 Alpha (early 2000)
Version:
$Date: 2003/02/10 22:52:45 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
MimeOutputStream(java.io.OutputStream o)
          Constructor!
 
Method Summary
 void flush()
          Flush the stream.
 void write(int c)
          Write the specified byte, performing mime encoding.
 
Methods inherited from class java.io.FilterOutputStream
close, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MimeOutputStream

public MimeOutputStream(java.io.OutputStream o)
Constructor!

Method Detail

write

public void write(int c)
           throws java.io.IOException
Write the specified byte, performing mime encoding.

Override this method, since all other write methods call it.

Throws:
java.io.IOException - If an I/O error occurs

flush

public void flush()
           throws java.io.IOException
Flush the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

This version does not buffer, but Mime encoding may have some trailing stuff, which needs padding.

Throws:
java.io.IOException - If an I/O error occurs


Copyright © 2001-2003 by The GroboUtils Project