public class Radix64OutputStream extends FilterOutputStream
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.
FilterOutputStream
Modifier and Type | Field and Description |
---|---|
private byte[] |
buf |
private int |
c |
private int |
w |
out
Constructor and Description |
---|
Radix64OutputStream(OutputStream out)
Construct a new
Radix64OutputStream to filter the given
output stream. |
Modifier and Type | Method and Description |
---|---|
void |
flush()
Flush the output stream.
|
void |
write(int b)
Write a byte to the output stream.
|
close, write, write
public Radix64OutputStream(OutputStream out)
Radix64OutputStream
to filter the given
output stream.out
- The OutputStream
to filter.public void write(int b) throws IOException
write
in class FilterOutputStream
b
- The byte to encode and write.IOException
public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterOutputStream
IOException
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses