kiwi.io
Class Radix64OutputStream
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--kiwi.io.Radix64OutputStream
- public class Radix64OutputStream
- extends FilterOutputStream
This class implements a Radix-64 encoding filter. It accepts binary data
written to it and writes the encoded form of the data to its output
stream. To encode a file in Radix-64, one would do something like the
following:
File f = new File("plain.txt");
Radix64OutputStream r64out = new Radix64OutputStream(System.out);
FileInputStream fin = new FileInputStream(f);
int b;
while((b = f.read()) >= 0)
r64out.write(b);
The encoded data in this case will be written to standard output.
This filter generates 64-column-wide output with a newline character after
each line.
- Version:
- 1.0 (10/98)
- Author:
- Mark Lindner, PING Software Group
- See Also:
FilterOutputStream
Method Summary |
void |
flush()
Flush the output stream. |
void |
write(int b)
Write a byte to the output stream. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Radix64OutputStream
public Radix64OutputStream(OutputStream out)
- Construct a new
Radix64OutputStream
to filter the given
output stream.
- Parameters:
out
- The OutputStream
to filter.
write
public void write(int b)
throws IOException
- Write a byte to the output stream.
- Parameters:
b
- The byte to encode and write.- Overrides:
- write in class FilterOutputStream
flush
public void flush()
throws IOException
- Flush the output stream. Write any remaining data in the encode buffer
to the output stream.
- Overrides:
- flush in class FilterOutputStream