public class IO
extends java.lang.Object
Constructor and Description |
---|
IO() |
Modifier and Type | Method and Description |
---|---|
static void |
copy(java.io.InputStream is,
java.io.OutputStream os)
Copy an stream to another one.
|
static void |
copyDirectory(java.io.File source,
java.io.File target) |
static byte[] |
readContent(java.io.File file)
Read binary content of a file (warning does not use on large file !)
|
static byte[] |
readContent(java.io.InputStream is)
Read binary content of a stream (warning does not use on large file !)
|
static java.lang.String |
readContentAsString(java.io.File file)
Read file content to a String (always use utf-8)
|
static java.lang.String |
readContentAsString(java.io.File file,
java.lang.String encoding)
Read file content to a String
|
static java.lang.String |
readContentAsString(java.io.InputStream is)
Read the Stream content as a string (use utf-8)
|
static java.lang.String |
readContentAsString(java.io.InputStream is,
java.lang.String encoding)
Read the Stream content as a string
|
static java.util.List<java.lang.String> |
readLines(java.io.File file) |
static java.util.List<java.lang.String> |
readLines(java.io.File file,
java.lang.String encoding) |
static java.util.List<java.lang.String> |
readLines(java.io.InputStream is) |
static java.util.Properties |
readUtf8Properties(java.io.InputStream is)
Read a properties file with the utf-8 encoding
|
static void |
write(byte[] data,
java.io.File file)
Write binary data to a file
|
static void |
write(java.io.InputStream is,
java.io.File f)
Copy an stream to another one.
|
static void |
write(java.io.InputStream is,
java.io.OutputStream os)
Copy an stream to another one.
|
static void |
writeContent(java.lang.CharSequence content,
java.io.File file)
Write String content to a file (always use utf-8)
|
static void |
writeContent(java.lang.CharSequence content,
java.io.File file,
java.lang.String encoding)
Write String content to a file (always use utf-8)
|
static void |
writeContent(java.lang.CharSequence content,
java.io.OutputStream os)
Write String content to a stream (always use utf-8)
|
static void |
writeContent(java.lang.CharSequence content,
java.io.OutputStream os,
java.lang.String encoding)
Write String content to a stream (always use utf-8)
|
public static java.util.Properties readUtf8Properties(java.io.InputStream is)
is
- Stream to properties filepublic static java.lang.String readContentAsString(java.io.InputStream is)
is
- The stream to readpublic static java.lang.String readContentAsString(java.io.InputStream is, java.lang.String encoding)
is
- The stream to readencoding
- Encoding to usedpublic static java.lang.String readContentAsString(java.io.File file)
file
- The file to readpublic static java.lang.String readContentAsString(java.io.File file, java.lang.String encoding)
file
- The file to readencoding
- Encoding to usedpublic static java.util.List<java.lang.String> readLines(java.io.InputStream is)
public static java.util.List<java.lang.String> readLines(java.io.File file, java.lang.String encoding)
public static java.util.List<java.lang.String> readLines(java.io.File file)
public static byte[] readContent(java.io.File file)
file
- The file te readpublic static byte[] readContent(java.io.InputStream is)
is
- The stream to readpublic static void writeContent(java.lang.CharSequence content, java.io.OutputStream os)
content
- The content to writeos
- The stream to writepublic static void writeContent(java.lang.CharSequence content, java.io.OutputStream os, java.lang.String encoding)
content
- The content to writeos
- The stream to writeencoding
- Encoding to usedpublic static void writeContent(java.lang.CharSequence content, java.io.File file)
content
- The content to writefile
- The file to writepublic static void writeContent(java.lang.CharSequence content, java.io.File file, java.lang.String encoding)
content
- The content to writefile
- The file to writeencoding
- Encoding to usedpublic static void write(byte[] data, java.io.File file)
data
- The binary data to writefile
- The file to writepublic static void copy(java.io.InputStream is, java.io.OutputStream os)
is
- The source streamos
- The destination streampublic static void write(java.io.InputStream is, java.io.OutputStream os)
is
- The source streamos
- The destination streampublic static void write(java.io.InputStream is, java.io.File f)
is
- The source streamf
- The destination filepublic static void copyDirectory(java.io.File source, java.io.File target)
Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly