| java.lang.Object com.Ostermiller.util.LineEnds
LineEnds | public class LineEnds (Code) | | Stream editor to alter the line separators on text to match
that of a given platform.
More information about this class is available from ostermiller.org.
author: Stephen Ostermiller http://ostermiller.org/contact.pl?regarding=Java+Utilities since: ostermillerutils 1.00.00 |
Method Summary | |
public static boolean | convert(InputStream in, OutputStream out) Change the line endings of the text on the input stream and write
it to the output stream.
The current system's line separator is used.
Parameters: in - stream that contains the text which needs line number conversion. Parameters: out - stream where converted text is written. | public static boolean | convert(InputStream in, OutputStream out, int style) Change the line endings of the text on the input stream and write
it to the output stream.
Parameters: in - stream that contains the text which needs line number conversion. Parameters: out - stream where converted text is written. Parameters: style - line separator style. | public static boolean | convert(InputStream in, OutputStream out, boolean binaryException) Change the line endings of the text on the input stream and write
it to the output stream.
The current system's line separator is used.
Parameters: in - stream that contains the text which needs line number conversion. Parameters: out - stream where converted text is written. Parameters: binaryException - throw an exception and abort the operation if binary data is encountered and binaryExcepion is false. | public static boolean | convert(InputStream in, OutputStream out, int style, boolean binaryException) Change the line endings of the text on the input stream and write
it to the output stream.
Parameters: in - stream that contains the text which needs line number conversion. Parameters: out - stream where converted text is written. Parameters: style - line separator style. Parameters: binaryException - throw an exception and abort the operation if binary data is encountered and binaryExcepion is false. | public static boolean | convert(File f) Change the line endings on given file.
The current system's line separator is used.
Parameters: f - File to be converted. | public static boolean | convert(File f, int style) Change the line endings on given file.
Parameters: f - File to be converted. Parameters: style - line separator style. | public static boolean | convert(File f, boolean binaryException) Change the line endings on given file.
The current system's line separator is used.
Parameters: f - File to be converted. Parameters: binaryException - throw an exception and abort the operation if binary data is encountered and binaryExcepion is false. | public static boolean | convert(File f, int style, boolean binaryException) Change the line endings on given file.
Parameters: f - File to be converted. Parameters: style - line separator style. Parameters: binaryException - throw an exception and abort the operation if binary data is encountered and binaryExcepion is false. | public static void | main(String[] args) Converts the line ending on files, or standard input. |
STYLE_DOS | final public static int STYLE_DOS(Code) | | The Windows and DOS line ending ("\r\n")
since: ostermillerutils 1.00.00 |
STYLE_JAVA | final public static int STYLE_JAVA(Code) | | The UNIX and Java line ending ("\n")
since: ostermillerutils 1.00.00 |
STYLE_MAC | final public static int STYLE_MAC(Code) | | The MacIntosh line ending ("\r")
since: ostermillerutils 1.00.00 |
STYLE_N | final public static int STYLE_N(Code) | | The UNIX and Java line ending ("\n")
since: ostermillerutils 1.00.00 |
STYLE_R | final public static int STYLE_R(Code) | | The MacIntosh line ending ("\r")
since: ostermillerutils 1.00.00 |
STYLE_RN | final public static int STYLE_RN(Code) | | The Windows and DOS line ending ("\r\n")
since: ostermillerutils 1.00.00 |
STYLE_SYSTEM | final public static int STYLE_SYSTEM(Code) | | The system line ending as determined
by System.getProperty("line.separator")
since: ostermillerutils 1.00.00 |
STYLE_UNIX | final public static int STYLE_UNIX(Code) | | The UNIX and Java line ending ("\n")
since: ostermillerutils 1.00.00 |
STYLE_WINDOWS | final public static int STYLE_WINDOWS(Code) | | The Windows and DOS line ending ("\r\n")
since: ostermillerutils 1.00.00 |
labels | protected static ResourceBundle labels(Code) | | Locale specific strings displayed to the user.
since: ostermillerutils 1.00.00 |
version | final public static String version(Code) | | Version number of this program
since: ostermillerutils 1.00.00 |
convert | public static boolean convert(InputStream in, OutputStream out) throws IOException(Code) | | Change the line endings of the text on the input stream and write
it to the output stream.
The current system's line separator is used.
Parameters: in - stream that contains the text which needs line number conversion. Parameters: out - stream where converted text is written. true if the output was modified from the input, false if it is exactly the same throws: BinaryDataException - if non-text data is encountered. throws: IOException - if an input or output error occurs. since: ostermillerutils 1.00.00 |
convert | public static boolean convert(InputStream in, OutputStream out, int style) throws IOException(Code) | | Change the line endings of the text on the input stream and write
it to the output stream.
Parameters: in - stream that contains the text which needs line number conversion. Parameters: out - stream where converted text is written. Parameters: style - line separator style. true if the output was modified from the input, false if it is exactly the same throws: BinaryDataException - if non-text data is encountered. throws: IOException - if an input or output error occurs. throws: IllegalArgumentException - if an unknown style is requested. since: ostermillerutils 1.00.00 |
convert | public static boolean convert(InputStream in, OutputStream out, boolean binaryException) throws IOException(Code) | | Change the line endings of the text on the input stream and write
it to the output stream.
The current system's line separator is used.
Parameters: in - stream that contains the text which needs line number conversion. Parameters: out - stream where converted text is written. Parameters: binaryException - throw an exception and abort the operation if binary data is encountered and binaryExcepion is false. true if the output was modified from the input, false if it is exactly the same throws: BinaryDataException - if non-text data is encountered. throws: IOException - if an input or output error occurs. since: ostermillerutils 1.00.00 |
convert | public static boolean convert(InputStream in, OutputStream out, int style, boolean binaryException) throws IOException(Code) | | Change the line endings of the text on the input stream and write
it to the output stream.
Parameters: in - stream that contains the text which needs line number conversion. Parameters: out - stream where converted text is written. Parameters: style - line separator style. Parameters: binaryException - throw an exception and abort the operation if binary data is encountered and binaryExcepion is false. true if the output was modified from the input, false if it is exactly the same throws: BinaryDataException - if non-text data is encountered. throws: IOException - if an input or output error occurs. throws: IllegalArgumentException - if an unknown style is requested. since: ostermillerutils 1.00.00 |
convert | public static boolean convert(File f) throws IOException(Code) | | Change the line endings on given file.
The current system's line separator is used.
Parameters: f - File to be converted. true if the file was modified, false if it was already in the correct format throws: BinaryDataException - if non-text data is encountered. throws: IOException - if an input or output error occurs. since: ostermillerutils 1.00.00 |
convert | public static boolean convert(File f, int style) throws IOException(Code) | | Change the line endings on given file.
Parameters: f - File to be converted. Parameters: style - line separator style. true if the file was modified, false if it was already in the correct format throws: BinaryDataException - if non-text data is encountered. throws: IOException - if an input or output error occurs. throws: IllegalArgumentException - if an unknown style is requested. since: ostermillerutils 1.00.00 |
convert | public static boolean convert(File f, boolean binaryException) throws IOException(Code) | | Change the line endings on given file.
The current system's line separator is used.
Parameters: f - File to be converted. Parameters: binaryException - throw an exception and abort the operation if binary data is encountered and binaryExcepion is false. true if the file was modified, false if it was already in the correct format throws: BinaryDataException - if non-text data is encountered. throws: IOException - if an input or output error occurs. since: ostermillerutils 1.00.00 |
convert | public static boolean convert(File f, int style, boolean binaryException) throws IOException(Code) | | Change the line endings on given file.
Parameters: f - File to be converted. Parameters: style - line separator style. Parameters: binaryException - throw an exception and abort the operation if binary data is encountered and binaryExcepion is false. true if the file was modified, false if it was already in the correct format throws: BinaryDataException - if non-text data is encountered. throws: IOException - if an input or output error occurs. throws: IllegalArgumentException - if an unknown style is requested. since: ostermillerutils 1.00.00 |
main | public static void main(String[] args)(Code) | | Converts the line ending on files, or standard input.
Run with --help argument for more information.
Parameters: args - Command line arguments. since: ostermillerutils 1.00.00 |
|
|