|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.elasticsearch.common.io.Streams
public abstract class Streams
Simple utility methods for file and stream copying. All copy methods use a block size of 4096 bytes, and close all affected streams when done.
Mainly for use within the framework, but also useful for application code.
| Field Summary | |
|---|---|
static int |
BUFFER_SIZE
|
| Constructor Summary | |
|---|---|
Streams()
|
|
| Method Summary | |
|---|---|
static void |
copy(byte[] in,
java.io.File out)
Copy the contents of the given byte array to the given output File. |
static void |
copy(byte[] in,
java.io.OutputStream out)
Copy the contents of the given byte array to the given OutputStream. |
static long |
copy(java.io.File in,
java.io.File out)
Copy the contents of the given input File to the given output File. |
static long |
copy(java.io.InputStream in,
java.io.OutputStream out)
|
static long |
copy(java.io.InputStream in,
java.io.OutputStream out,
byte[] buffer)
Copy the contents of the given InputStream to the given OutputStream. |
static int |
copy(java.io.Reader in,
java.io.Writer out)
Copy the contents of the given Reader to the given Writer. |
static void |
copy(java.lang.String in,
java.io.Writer out)
Copy the contents of the given String to the given output Writer. |
static byte[] |
copyToByteArray(java.io.File in)
Copy the contents of the given input File into a new byte array. |
static byte[] |
copyToByteArray(java.io.InputStream in)
Copy the contents of the given InputStream into a new byte array. |
static byte[] |
copyToBytesFromClasspath(java.lang.String path)
|
static java.lang.String |
copyToString(java.io.Reader in)
Copy the contents of the given Reader into a String. |
static java.lang.String |
copyToStringFromClasspath(java.lang.ClassLoader classLoader,
java.lang.String path)
|
static java.lang.String |
copyToStringFromClasspath(java.lang.String path)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BUFFER_SIZE
| Constructor Detail |
|---|
public Streams()
| Method Detail |
|---|
public static long copy(java.io.File in,
java.io.File out)
throws java.io.IOException
in - the file to copy fromout - the file to copy to
java.io.IOException - in case of I/O errors
public static void copy(byte[] in,
java.io.File out)
throws java.io.IOException
in - the byte array to copy fromout - the file to copy to
java.io.IOException - in case of I/O errors
public static byte[] copyToByteArray(java.io.File in)
throws java.io.IOException
in - the file to copy from
java.io.IOException - in case of I/O errors
public static long copy(java.io.InputStream in,
java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
public static long copy(java.io.InputStream in,
java.io.OutputStream out,
byte[] buffer)
throws java.io.IOException
in - the stream to copy fromout - the stream to copy to
java.io.IOException - in case of I/O errors
public static void copy(byte[] in,
java.io.OutputStream out)
throws java.io.IOException
in - the byte array to copy fromout - the OutputStream to copy to
java.io.IOException - in case of I/O errors
public static byte[] copyToByteArray(java.io.InputStream in)
throws java.io.IOException
in - the stream to copy from
java.io.IOException - in case of I/O errors
public static int copy(java.io.Reader in,
java.io.Writer out)
throws java.io.IOException
in - the Reader to copy fromout - the Writer to copy to
java.io.IOException - in case of I/O errors
public static void copy(java.lang.String in,
java.io.Writer out)
throws java.io.IOException
in - the String to copy fromout - the Writer to copy to
java.io.IOException - in case of I/O errors
public static java.lang.String copyToString(java.io.Reader in)
throws java.io.IOException
in - the reader to copy from
java.io.IOException - in case of I/O errors
public static java.lang.String copyToStringFromClasspath(java.lang.ClassLoader classLoader,
java.lang.String path)
throws java.io.IOException
java.io.IOException
public static java.lang.String copyToStringFromClasspath(java.lang.String path)
throws java.io.IOException
java.io.IOException
public static byte[] copyToBytesFromClasspath(java.lang.String path)
throws java.io.IOException
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||