Class IoModule
- java.lang.Object
-
- com.googlecode.aviator.runtime.module.IoModule
-
public class IoModule extends java.lang.ObjectA simple io module for aviator
-
-
Field Summary
Fields Modifier and Type Field Description private static intBUFFER_SIZEprivate static intINIT_BUFFER_SIZE
-
Constructor Summary
Constructors Constructor Description IoModule()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidclose(java.io.Closeable closeable)static booleandelete(java.io.File file)static booleanexists(java.io.File file)static java.io.Filefile(java.lang.String path)A function to return java.io.File instance by path.static java.io.File[]files(java.io.File file)static java.io.InputStreaminputStream(java.io.File file)static java.io.InputStreaminputStream(java.net.URL url)static java.io.FileOutputStreamoutputStream(java.io.File file)intread(java.io.InputStream in)static java.io.BufferedReaderreader(java.io.File file)static java.io.BufferedReaderreader(java.io.File file, java.lang.String charsetName)static java.io.BufferedReaderreader(java.io.InputStream in)static java.io.BufferedReaderreader(java.io.InputStream in, java.lang.String charsetName)private static byte[]resizeBuffer(byte[] buffer, int newSize, int len)static java.net.URLresource(java.lang.String name)static LineSequenceseq(java.io.BufferedReader reader)static LineSequenceseq(java.io.File file)cast a file into a sequence of text lines in file.static java.lang.Stringslurp(java.io.File file)static java.lang.Stringslurp(java.io.File file, java.lang.String charset)static java.lang.Stringslurp(java.lang.String path)slurp function to read file fully as a string.static java.lang.Stringslurp(java.lang.String path, java.lang.String charset)static java.lang.Stringslurp(java.net.URL file)static java.lang.Stringslurp(java.net.URL file, java.lang.String charset)static voidspit(java.io.File file, java.lang.String content)static voidspit(java.io.File file, java.lang.String content, java.lang.String charset)static voidspit(java.lang.String path, java.lang.String content)spit function to write a string fully to file.static voidspit(java.lang.String path, java.lang.String content, java.lang.String charset)voidwrite(java.io.OutputStream out, int b)static java.io.BufferedWriterwriter(java.io.File file)static java.io.BufferedWriterwriter(java.io.File file, java.lang.String charsetName)static java.io.BufferedWriterwriter(java.io.OutputStream out)static java.io.BufferedWriterwriter(java.io.OutputStream out, java.lang.String charsetName)
-
-
-
Field Detail
-
INIT_BUFFER_SIZE
private static final int INIT_BUFFER_SIZE
- See Also:
- Constant Field Values
-
BUFFER_SIZE
private static final int BUFFER_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
file
public static final java.io.File file(java.lang.String path)
A function to return java.io.File instance by path.- Parameters:
path-- Returns:
-
exists
public static boolean exists(java.io.File file)
-
files
public static java.io.File[] files(java.io.File file)
-
resource
public static final java.net.URL resource(java.lang.String name)
-
inputStream
public static java.io.InputStream inputStream(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
inputStream
public static java.io.InputStream inputStream(java.net.URL url) throws java.io.IOException- Throws:
java.io.IOException
-
outputStream
public static java.io.FileOutputStream outputStream(java.io.File file) throws java.io.FileNotFoundException- Throws:
java.io.FileNotFoundException
-
read
public int read(java.io.InputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
write
public void write(java.io.OutputStream out, int b) throws java.io.IOException- Throws:
java.io.IOException
-
reader
public static java.io.BufferedReader reader(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
reader
public static java.io.BufferedReader reader(java.io.File file, java.lang.String charsetName) throws java.io.IOException- Throws:
java.io.IOException
-
reader
public static java.io.BufferedReader reader(java.io.InputStream in) throws java.io.IOException- Throws:
java.io.IOException
-
reader
public static java.io.BufferedReader reader(java.io.InputStream in, java.lang.String charsetName) throws java.io.IOException- Throws:
java.io.IOException
-
writer
public static java.io.BufferedWriter writer(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
writer
public static java.io.BufferedWriter writer(java.io.File file, java.lang.String charsetName) throws java.io.IOException- Throws:
java.io.IOException
-
writer
public static java.io.BufferedWriter writer(java.io.OutputStream out) throws java.io.IOException- Throws:
java.io.IOException
-
writer
public static java.io.BufferedWriter writer(java.io.OutputStream out, java.lang.String charsetName) throws java.io.IOException- Throws:
java.io.IOException
-
slurp
public static java.lang.String slurp(java.lang.String path) throws java.io.IOExceptionslurp function to read file fully as a string.- Parameters:
path-- Returns:
- Throws:
java.io.IOException
-
slurp
public static java.lang.String slurp(java.lang.String path, java.lang.String charset) throws java.io.IOException- Throws:
java.io.IOException
-
slurp
public static java.lang.String slurp(java.io.File file) throws java.io.IOException- Throws:
java.io.IOException
-
delete
public static boolean delete(java.io.File file)
-
slurp
public static java.lang.String slurp(java.io.File file, java.lang.String charset) throws java.io.IOException- Throws:
java.io.IOException
-
slurp
public static java.lang.String slurp(java.net.URL file) throws java.io.IOException- Throws:
java.io.IOException
-
resizeBuffer
private static byte[] resizeBuffer(byte[] buffer, int newSize, int len)
-
slurp
public static java.lang.String slurp(java.net.URL file, java.lang.String charset) throws java.io.IOException- Throws:
java.io.IOException
-
spit
public static void spit(java.lang.String path, java.lang.String content) throws java.io.IOExceptionspit function to write a string fully to file.- Parameters:
path-- Throws:
java.io.IOException
-
spit
public static void spit(java.lang.String path, java.lang.String content, java.lang.String charset) throws java.io.IOException- Throws:
java.io.IOException
-
spit
public static void spit(java.io.File file, java.lang.String content) throws java.io.IOException- Throws:
java.io.IOException
-
spit
public static void spit(java.io.File file, java.lang.String content, java.lang.String charset) throws java.io.IOException- Throws:
java.io.IOException
-
seq
public static LineSequence seq(java.io.File file) throws java.io.IOException
cast a file into a sequence of text lines in file.- Parameters:
file-- Returns:
- Throws:
java.io.IOException
-
seq
public static LineSequence seq(java.io.BufferedReader reader)
-
close
public static void close(java.io.Closeable closeable)
-
-