org.apache.commons.net.io

Class FromNetASCIIInputStream

public final class FromNetASCIIInputStream extends PushbackInputStream

This class wraps an input stream, replacing all occurrences of <CR><LF> (carriage return followed by a linefeed), which is the NETASCII standard for representing a newline, with the local line separator representation. You would use this class to implement ASCII file transfers requiring conversion from NETASCII.

Author: Daniel F. Savarese

Constructor Summary
FromNetASCIIInputStream(InputStream input)
Creates a FromNetASCIIInputStream instance that wraps an existing InputStream.
Method Summary
static booleanisConversionRequired()
Returns true if the NetASCII line separator differs from the system line separator, false if they are the same.

Constructor Detail

FromNetASCIIInputStream

public FromNetASCIIInputStream(InputStream input)
Creates a FromNetASCIIInputStream instance that wraps an existing InputStream.

Method Detail

isConversionRequired

public static final boolean isConversionRequired()
Returns true if the NetASCII line separator differs from the system line separator, false if they are the same. This method is useful to determine whether or not you need to instantiate a FromNetASCIIInputStream object.

Returns: True if the NETASCII line separator differs from the local system line separator, false if they are the same.