play.libs
类 IO

java.lang.Object
  继承者 play.libs.IO

public class IO
extends java.lang.Object

IO utils


构造方法摘要
IO()
           
 
方法摘要
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 binay 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)
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

IO

public IO()
方法详细信息

readUtf8Properties

public static java.util.Properties readUtf8Properties(java.io.InputStream is)
Read a properties file with the utf-8 encoding

参数:
is - Stream to properties file
返回:
The Properties object

readContentAsString

public static java.lang.String readContentAsString(java.io.InputStream is)
Read the Stream content as a string (use utf-8)

参数:
is - The stream to read
返回:
The String content

readContentAsString

public static java.lang.String readContentAsString(java.io.InputStream is,
                                                   java.lang.String encoding)
Read the Stream content as a string

参数:
is - The stream to read
返回:
The String content

readContentAsString

public static java.lang.String readContentAsString(java.io.File file)
Read file content to a String (always use utf-8)

参数:
file - The file to read
返回:
The String content

readContentAsString

public static java.lang.String readContentAsString(java.io.File file,
                                                   java.lang.String encoding)
Read file content to a String

参数:
file - The file to read
返回:
The String content

readLines

public static java.util.List<java.lang.String> readLines(java.io.InputStream is)

readLines

public static java.util.List<java.lang.String> readLines(java.io.File file,
                                                         java.lang.String encoding)

readLines

public static java.util.List<java.lang.String> readLines(java.io.File file)

readContent

public static byte[] readContent(java.io.File file)
Read binary content of a file (warning does not use on large file !)

参数:
file - The file te read
返回:
The binary data

readContent

public static byte[] readContent(java.io.InputStream is)
Read binary content of a stream (warning does not use on large file !)

参数:
is - The stream to read
返回:
The binary data

writeContent

public static void writeContent(java.lang.CharSequence content,
                                java.io.OutputStream os)
Write String content to a stream (always use utf-8)

参数:
content - The content to write
os - The stream to write

writeContent

public 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)

参数:
content - The content to write
os - The stream to write

writeContent

public static void writeContent(java.lang.CharSequence content,
                                java.io.File file)
Write String content to a file (always use utf-8)

参数:
content - The content to write
file - The file to write

writeContent

public 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)

参数:
content - The content to write
file - The file to write

write

public static void write(byte[] data,
                         java.io.File file)
Write binay data to a file

参数:
data - The binary data to write
file - The file to write

copy

public static void copy(java.io.InputStream is,
                        java.io.OutputStream os)
Copy an stream to another one.


write

public static void write(java.io.InputStream is,
                         java.io.OutputStream os)
Copy an stream to another one.


write

public static void write(java.io.InputStream is,
                         java.io.File f)
Copy an stream to another one.


copyDirectory

public static void copyDirectory(java.io.File source,
                                 java.io.File target)


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly