Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.finj.filter
Class ASCIIDataFilterInputStream  view ASCIIDataFilterInputStream download ASCIIDataFilterInputStream.java

java.lang.Object
  extended byjava.io.InputStream
      extended byjava.io.FilterInputStream
          extended byorg.finj.filter.ASCIIDataFilterInputStream
All Implemented Interfaces:
java.io.Closeable

public class ASCIIDataFilterInputStream
extends java.io.FilterInputStream

Filter to be placed on InputStream when downloading data in org.finj.FTPConstants.ASCII_DATA_TYPE. Exchanges all occurrences of CR, CR/LF, LF/CR, LF for the one that is correct for the plateform on which org.finj.FTPClient is running. FIXME : mention default values. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Version:
$Id: ASCIIDataFilterInputStream.java,v 1.1.1.1 2003/05/12 16:37:27 jiglesia Exp $

Field Summary
private  int CR_CODE
          Defines the integer value corresponding to the CarriageReturn character in the table.
private  int LF_CODE
          Defines the integer value that corresponding to the LineFeed character in the table.
 
Fields inherited from class java.io.FilterInputStream
in
 
Constructor Summary
  ASCIIDataFilterInputStream(java.io.InputStream in)
          Constructs a new instance of this class, wrapping and filtering in.
protected ASCIIDataFilterInputStream(java.io.InputStream in, int lineFeed, int carriageReturn)
          Constructs a new instance of this class, resetting the integer values for the LineFeed and CarriageReturn characters to the values provided.
 
Method Summary
 int read()
          Returns one filtered byte from the undelying fields.
 int read(byte[] data)
          Stores as much filtered data as possible to read from the underlying stream.
 int read(byte[] data, int offset, int length)
          Stores as much filtered data as possible to read from the underlying stream.
 
Methods inherited from class java.io.FilterInputStream
available, close, mark, markSupported, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LF_CODE

private int LF_CODE
Defines the integer value that corresponding to the LineFeed character in the table.

Since:
v1.0.2

CR_CODE

private int CR_CODE
Defines the integer value corresponding to the CarriageReturn character in the table.

Since:
v1.0.2
Constructor Detail

ASCIIDataFilterInputStream

public ASCIIDataFilterInputStream(java.io.InputStream in)
Constructs a new instance of this class, wrapping and filtering in.

Since:
v1.0.2

ASCIIDataFilterInputStream

protected ASCIIDataFilterInputStream(java.io.InputStream in,
                                     int lineFeed,
                                     int carriageReturn)
Constructs a new instance of this class, resetting the integer values for the LineFeed and CarriageReturn characters to the values provided.

Since:
v1.0.2
Method Detail

read

public int read()
         throws java.io.IOException
Returns one filtered byte from the undelying fields. Any occurrence of LF, or LF+CR, or CR+LF, or CR is replaced by the local system '\n' character. Decision is left to the JVM !

Since:
v1.0.2

read

public int read(byte[] data)
         throws java.io.IOException
Stores as much filtered data as possible to read from the underlying stream.

Since:
v1.0.2

read

public int read(byte[] data,
                int offset,
                int length)
         throws java.io.IOException
Stores as much filtered data as possible to read from the underlying stream.

Since:
v1.0.2