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. APrintWriter
would 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 void
close()
void
flush()
void
write(char[] cbuf)
void
write(char[] cbuf, int off, int len)
void
write(int c)
void
write(String str)
void
write(String str, int off, int len)
void
writeNewLine()
Writes a new line according to the defined line separator
-
-
-
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 IOException
Writes 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:
write
in classWriter
- Throws:
IOException
-
write
public void write(char[] cbuf) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(char[] cbuf, int off, int len) throws IOException
- Specified by:
write
in classWriter
- Throws:
IOException
-
write
public void write(String str) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
write
public void write(String str, int off, int len) throws IOException
- Overrides:
write
in classWriter
- Throws:
IOException
-
flush
public void flush() throws IOException
- Specified by:
flush
in interfaceFlushable
- Specified by:
flush
in classWriter
- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classWriter
- Throws:
IOException
-
-