public class UndoableWriterWrapper
extends java.io.Writer
UndoableWriterWrapper wr = new UndoableWriterWrapper(actualWriter);
// start undoable writing
wr.markSavePoint();
try
{
// ... write into wrapper ...
// finally store changes
wr.commitSavePoint();
}
catch (Exception e)
{
// discard any changes
wr.restoreSavePoint();
}
| Constructor and Description |
|---|
UndoableWriterWrapper(java.io.Writer writer) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
commitSavePoint() |
void |
flush() |
void |
markSavePoint() |
void |
restoreSavePoint() |
void |
write(char[] cbuf,
int off,
int len) |
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Writerjava.io.IOExceptionpublic void flush()
throws java.io.IOException
flush in interface java.io.Flushableflush in class java.io.Writerjava.io.IOExceptionpublic void write(char[] cbuf,
int off,
int len)
throws java.io.IOException
write in class java.io.Writerjava.io.IOExceptionpublic void markSavePoint()
public void restoreSavePoint()
public void commitSavePoint()
Copyright © 2018 SAP SE. All Rights Reserved.