org.apache.ftpserver.util
Class AsciiOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.apache.ftpserver.util.AsciiOutputStream

public class AsciiOutputStream
extends java.io.OutputStream

Write ASCII data. Before writing it filters the data.

Author:
Rana Bhattacharyya

Constructor Summary
AsciiOutputStream(java.io.OutputStream os)
          Constructor.
 
Method Summary
 void close()
          Close stream
 void flush()
          Flush stream data
 long getByteWritten()
          Get actual byte written.
 boolean getIsIgnoreNonAscii()
          Is non ascii character ignored.
 void setIsIgnoreNonAscii(boolean ig)
          Set non-ascii ignore boolean value.
 void write(int i)
          Write a single byte.
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AsciiOutputStream

public AsciiOutputStream(java.io.OutputStream os)
Constructor.

Parameters:
os - java.io.OutputStream to be filtered.
Method Detail

write

public void write(int i)
           throws java.io.IOException
Write a single byte. ASCII characters are defined to be the lower half of an eight-bit code set (i.e., the most significant bit is zero). Change "\n" to "\r\n".

Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Close stream

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flush stream data

Throws:
java.io.IOException

getByteWritten

public long getByteWritten()
Get actual byte written.


getIsIgnoreNonAscii

public boolean getIsIgnoreNonAscii()
Is non ascii character ignored. If true don't write non-ascii character. Else first convert it to ascii by ANDing with 0x7F.


setIsIgnoreNonAscii

public void setIsIgnoreNonAscii(boolean ig)
Set non-ascii ignore boolean value.



Copyright © 2001-2007 Codehaus. All Rights Reserved.