|
com.Ostermiller.util Java Utilities |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.Ostermiller.util.LineEnds
public class LineEnds
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.
Field Summary | |
---|---|
static int |
STYLE_DOS
The Windows and DOS line ending ("\r\n") |
static int |
STYLE_JAVA
The UNIX and Java line ending ("\n") |
static int |
STYLE_MAC
The Macintosh line ending ("\r") |
static int |
STYLE_N
The UNIX and Java line ending ("\n") |
static int |
STYLE_R
The Macintosh line ending ("\r") |
static int |
STYLE_RN
The Windows and DOS line ending ("\r\n") |
static int |
STYLE_SYSTEM
The system line ending as determined by System.getProperty("line.separator") |
static int |
STYLE_UNIX
The UNIX and Java line ending ("\n") |
static int |
STYLE_WINDOWS
The Windows and DOS line ending ("\r\n") |
static String |
version
Version number of this program |
Constructor Summary | |
---|---|
LineEnds()
|
Method Summary | |
---|---|
static boolean |
convert(File f)
Change the line endings on given file. |
static boolean |
convert(File f,
boolean binaryException)
Change the line endings on given file. |
static boolean |
convert(File f,
int style)
Change the line endings on given file. |
static boolean |
convert(File f,
int style,
boolean binaryException)
Change the line endings on given file. |
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. |
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. |
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. |
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. |
static void |
main(String[] args)
Converts the line ending on files, or standard input. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String version
public static final int STYLE_SYSTEM
public static final int STYLE_WINDOWS
public static final int STYLE_DOS
public static final int STYLE_RN
public static final int STYLE_UNIX
public static final int STYLE_N
public static final int STYLE_JAVA
public static final int STYLE_MAC
public static final int STYLE_R
Constructor Detail |
---|
public LineEnds()
Method Detail |
---|
public static void main(String[] args)
args
- Command line arguments.public static boolean convert(InputStream in, OutputStream out) throws IOException
in
- stream that contains the text which needs line number conversion.out
- stream where converted text is written.
BinaryDataException
- if non-text data is encountered.
IOException
- if an input or output error occurs.public static boolean convert(InputStream in, OutputStream out, int style) throws IOException
in
- stream that contains the text which needs line number conversion.out
- stream where converted text is written.style
- line separator style.
BinaryDataException
- if non-text data is encountered.
IOException
- if an input or output error occurs.
IllegalArgumentException
- if an unknown style is requested.public static boolean convert(InputStream in, OutputStream out, boolean binaryException) throws IOException
in
- stream that contains the text which needs line number conversion.out
- stream where converted text is written.binaryException
- throw an exception and abort the operation if binary data is encountered and binaryExcepion is false.
BinaryDataException
- if non-text data is encountered.
IOException
- if an input or output error occurs.public static boolean convert(InputStream in, OutputStream out, int style, boolean binaryException) throws IOException
in
- stream that contains the text which needs line number conversion.out
- stream where converted text is written.style
- line separator style.binaryException
- throw an exception and abort the operation if binary data is encountered and binaryExcepion is false.
BinaryDataException
- if non-text data is encountered.
IOException
- if an input or output error occurs.
IllegalArgumentException
- if an unknown style is requested.public static boolean convert(File f) throws IOException
f
- File to be converted.
BinaryDataException
- if non-text data is encountered.
IOException
- if an input or output error occurs.public static boolean convert(File f, int style) throws IOException
f
- File to be converted.style
- line separator style.
BinaryDataException
- if non-text data is encountered.
IOException
- if an input or output error occurs.
IllegalArgumentException
- if an unknown style is requested.public static boolean convert(File f, boolean binaryException) throws IOException
f
- File to be converted.binaryException
- throw an exception and abort the operation if binary data is encountered and binaryExcepion is false.
BinaryDataException
- if non-text data is encountered.
IOException
- if an input or output error occurs.public static boolean convert(File f, int style, boolean binaryException) throws IOException
f
- File to be converted.style
- line separator style.binaryException
- throw an exception and abort the operation if binary data is encountered and binaryExcepion is false.
BinaryDataException
- if non-text data is encountered.
IOException
- if an input or output error occurs.
IllegalArgumentException
- if an unknown style is requested.
|
com.Ostermiller.util Java Utilities |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2001-2012 by Stephen Ostermiller