Class IoModule
java.lang.Object
com.googlecode.aviator.runtime.module.IoModule
A simple io module for aviator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic booleanstatic booleanstatic final FileA function to return java.io.File instance by path.static File[]static InputStreaminputStream(File file) static InputStreaminputStream(URL url) static FileOutputStreamoutputStream(File file) intread(InputStream in) static BufferedReaderstatic BufferedReaderstatic BufferedReaderreader(InputStream in) static BufferedReaderreader(InputStream in, String charsetName) private static byte[]resizeBuffer(byte[] buffer, int newSize, int len) static final URLstatic LineSequenceseq(BufferedReader reader) static LineSequencecast a file into a sequence of text lines in file.static Stringstatic Stringstatic Stringslurp function to read file fully as a string.static Stringstatic Stringstatic Stringstatic voidstatic voidstatic voidspit function to write a string fully to file.static voidvoidwrite(OutputStream out, int b) static BufferedWriterstatic BufferedWriterstatic BufferedWriterwriter(OutputStream out) static BufferedWriterwriter(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
-
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
-