Class DiffWriter
- java.lang.Object
-
- java.io.Writer
-
- org.apache.jackrabbit.vault.util.diff.DiffWriter
-
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable
public class DiffWriter extends Writer
Implements a writer that provides an additional methodwriteNewLine()that can be used for writing line separators which can be defined. APrintWriterwould actually be better, but it does not support defining the line separator to use.
-
-
Constructor Summary
Constructors Constructor Description DiffWriter(Writer out)Creates a new diff writer.DiffWriter(Writer out, String lineSeparator)Creates a new diff writer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()voidwrite(char[] cbuf)voidwrite(char[] cbuf, int off, int len)voidwrite(int c)voidwrite(String str)voidwrite(String str, int off, int len)voidwriteNewLine()Writes a new line according to the defined line separator-
Methods inherited from class java.io.Writer
append, append, append, nullWriter
-
-
-
-
Field Detail
-
LS_NATIVE
public static final String LS_NATIVE
native line separator
-
LS_UNIX
public static final String LS_UNIX
unix line separator- See Also:
- Constant Field Values
-
LS_WINDOWS
public static final String LS_WINDOWS
windows line separator- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DiffWriter
public DiffWriter(Writer out)
Creates a new diff writer.- Parameters:
out- the underlying writer.
-
DiffWriter
public DiffWriter(Writer out, String lineSeparator)
Creates a new diff writer.- Parameters:
out- the underlying writer.lineSeparator- the line seperator to use forwriteNewLine()
-
-
Method Detail
-
writeNewLine
public void writeNewLine() throws IOExceptionWrites a new line according to the defined line separator- Throws:
IOException- if an I/O error occurs
-
write
public void write(int c) throws IOException- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(char[] cbuf) throws IOException- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(char[] cbuf, int off, int len) throws IOException- Specified by:
writein classWriter- Throws:
IOException
-
write
public void write(String str) throws IOException
- Overrides:
writein classWriter- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
- Overrides:
writein classWriter- Throws:
IOException
-
flush
public void flush() throws IOException- Specified by:
flushin interfaceFlushable- Specified by:
flushin classWriter- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classWriter- Throws:
IOException
-
-