Package org.ujmp.core.util.io
Class IntelligentFileWriter
- java.lang.Object
-
- java.io.Writer
-
- org.ujmp.core.util.io.IntelligentFileWriter
-
- All Implemented Interfaces:
java.io.Closeable
,java.io.Flushable
,java.lang.Appendable
,java.lang.AutoCloseable
public class IntelligentFileWriter extends java.io.Writer implements java.lang.Appendable, java.io.Closeable, java.io.Flushable
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.BufferedWriter
bw
private java.lang.String
encoding
private java.io.FileWriter
fw
private static java.lang.String
SEVENZIPOUTPUTSTREAM
private java.io.OutputStream
zip
-
Constructor Summary
Constructors Constructor Description IntelligentFileWriter(java.io.File file)
IntelligentFileWriter(java.io.File file, boolean append)
IntelligentFileWriter(java.io.OutputStream outputStream)
IntelligentFileWriter(java.lang.String filename)
IntelligentFileWriter(java.lang.String filename, boolean append)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
append(java.lang.String filename, java.lang.String text)
void
close()
void
flush()
static void
save(java.io.File file, java.lang.String text)
static void
save(java.lang.String filename, java.lang.String text)
void
write(char[] cbuf, int off, int len)
static void
write(java.io.OutputStream os, java.lang.String text)
-
Methods inherited from class java.io.Writer
append, append, append, nullWriter, write, write, write, write
-
-
-
-
Field Detail
-
SEVENZIPOUTPUTSTREAM
private static final java.lang.String SEVENZIPOUTPUTSTREAM
- See Also:
- Constant Field Values
-
fw
private java.io.FileWriter fw
-
zip
private java.io.OutputStream zip
-
bw
private java.io.BufferedWriter bw
-
encoding
private java.lang.String encoding
-
-
Constructor Detail
-
IntelligentFileWriter
public IntelligentFileWriter(java.lang.String filename) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
IntelligentFileWriter
public IntelligentFileWriter(java.lang.String filename, boolean append) throws java.io.IOException, java.lang.ClassNotFoundException
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
IntelligentFileWriter
public IntelligentFileWriter(java.io.OutputStream outputStream) throws java.io.IOException
- Throws:
java.io.IOException
-
IntelligentFileWriter
public IntelligentFileWriter(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
IntelligentFileWriter
public IntelligentFileWriter(java.io.File file, boolean append) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
save
public static final void save(java.lang.String filename, java.lang.String text) throws java.lang.Exception
- Throws:
java.lang.Exception
-
save
public static final void save(java.io.File file, java.lang.String text) throws java.lang.Exception
- Throws:
java.lang.Exception
-
append
public static final void append(java.lang.String filename, java.lang.String text) throws java.lang.Exception
- Throws:
java.lang.Exception
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Specified by:
close
in classjava.io.Writer
- Throws:
java.io.IOException
-
flush
public void flush() throws java.io.IOException
- Specified by:
flush
in interfacejava.io.Flushable
- Specified by:
flush
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public void write(char[] cbuf, int off, int len) throws java.io.IOException
- Specified by:
write
in classjava.io.Writer
- Throws:
java.io.IOException
-
write
public static void write(java.io.OutputStream os, java.lang.String text)
-
-