Class IoModule
java.lang.Object
com.googlecode.aviator.runtime.module.IoModule
A simple io module for aviator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static boolean
static boolean
static final File
A function to return java.io.File instance by path.static File[]
static InputStream
inputStream
(File file) static InputStream
inputStream
(URL url) static FileOutputStream
outputStream
(File file) int
read
(InputStream in) static BufferedReader
static BufferedReader
static BufferedReader
reader
(InputStream in) static BufferedReader
reader
(InputStream in, String charsetName) private static byte[]
resizeBuffer
(byte[] buffer, int newSize, int len) static final URL
static LineSequence
seq
(BufferedReader reader) static LineSequence
cast a file into a sequence of text lines in file.static String
static String
static String
slurp function to read file fully as a string.static String
static String
static String
static void
static void
static void
spit function to write a string fully to file.static void
void
write
(OutputStream out, int b) static BufferedWriter
static BufferedWriter
static BufferedWriter
writer
(OutputStream out) static BufferedWriter
writer
(OutputStream out, String charsetName)
-
Field Details
-
INIT_BUFFER_SIZE
private static final int INIT_BUFFER_SIZE- See Also:
-
BUFFER_SIZE
private static final int BUFFER_SIZE- See Also:
-
-
Constructor Details
-
IoModule
public IoModule()
-
-
Method Details
-
file
A function to return java.io.File instance by path.- Parameters:
path
-- Returns:
-
exists
-
files
-
resource
-
inputStream
- Throws:
IOException
-
inputStream
- Throws:
IOException
-
outputStream
- Throws:
FileNotFoundException
-
read
- Throws:
IOException
-
write
- Throws:
IOException
-
reader
- Throws:
IOException
-
reader
- Throws:
IOException
-
reader
- Throws:
IOException
-
reader
- Throws:
IOException
-
writer
- Throws:
IOException
-
writer
- Throws:
IOException
-
writer
- Throws:
IOException
-
writer
- Throws:
IOException
-
slurp
slurp function to read file fully as a string.- Parameters:
path
-- Returns:
- Throws:
IOException
-
slurp
- Throws:
IOException
-
slurp
- Throws:
IOException
-
delete
-
slurp
- Throws:
IOException
-
slurp
- Throws:
IOException
-
resizeBuffer
private static byte[] resizeBuffer(byte[] buffer, int newSize, int len) -
slurp
- Throws:
IOException
-
spit
spit function to write a string fully to file.- Parameters:
path
-- Throws:
IOException
-
spit
- Throws:
IOException
-
spit
- Throws:
IOException
-
spit
- Throws:
IOException
-
seq
cast a file into a sequence of text lines in file.- Parameters:
file
-- Returns:
- Throws:
IOException
-
seq
-
close
-