edu.vt.middleware.crypt.io
Class HexFilterOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by java.io.FilterOutputStream
          extended by edu.vt.middleware.crypt.io.AbstractEncodingFilterOutputStream
              extended by edu.vt.middleware.crypt.io.HexFilterOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class HexFilterOutputStream
extends AbstractEncodingFilterOutputStream

Encodes raw bytes into hexadecimal characters in the wrapped output stream.

Version:
$Revision: 3 $
Author:
Middleware Services

Field Summary
 
Fields inherited from class java.io.FilterOutputStream
out
 
Constructor Summary
HexFilterOutputStream(OutputStream out)
          Creates a hex filter output stream around the given output stream.
 
Method Summary
protected  void writeEncoded(byte[] data, int offset, int length)
          Encode the given raw bytes and write the result to the wrapped output stream.
 
Methods inherited from class edu.vt.middleware.crypt.io.AbstractEncodingFilterOutputStream
write, write, write
 
Methods inherited from class java.io.FilterOutputStream
close, flush
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexFilterOutputStream

public HexFilterOutputStream(OutputStream out)
Creates a hex filter output stream around the given output stream.

Parameters:
out - Output stream to wrap.
Method Detail

writeEncoded

protected void writeEncoded(byte[] data,
                            int offset,
                            int length)
                     throws IOException
Encode the given raw bytes and write the result to the wrapped output stream.

Specified by:
writeEncoded in class AbstractEncodingFilterOutputStream
Parameters:
data - Raw bytes to be encoded and written.
offset - Starting index of data to be written in input byte array.
length - Number of bytes to be written from input byte array.
Throws:
IOException - On write errors.


Copyright © 2003-2011 Virginia Tech. All Rights Reserved.