|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.io.IO
Input/output toolkit
Field Summary | |
static java.io.OutputStream |
NULL_OUTPUT
Basic null output. |
Method Summary | |
static void |
askWetherToRetry(java.io.IOException e)
Asks the user wether to retry an interrupted I/O operation |
static void |
bufferedDump(java.io.InputStream input,
java.io.OutputStream output)
Dumps an input data stream to an output stream This implementation loads and writes data in a bufferized fashion |
static void |
bufferedDump(java.io.InputStream input,
java.io.OutputStream output,
long count)
Dumps an input data stream to an output stream This implementation loads and writes data in a bufferized fashion |
static java.io.File |
createTemporaryFile(java.io.File directory)
Creates a new temporary file. |
static java.io.InputStream |
getAsStream(java.lang.String content)
Turns a String to a readable stream |
static java.io.InputStream |
getAsStream(java.lang.String[] lines)
Turns a list of String s to a readable stream |
static java.lang.String |
getFromStream(java.io.InputStream stream)
Turns a stream to a String |
static java.lang.String |
getFromStream(java.io.InputStream stream,
boolean close)
Turns a stream to a String |
static java.lang.String[] |
getTokens(java.io.InputStream stream,
java.lang.String delimiters)
Tokenizes a stream. |
static void |
jar(byte[] data,
java.lang.String name,
java.util.jar.JarOutputStream jar)
Dumps a byte[] array of data to a new entry in a Jar archive |
static void |
jar(byte[] data,
java.lang.String name,
java.util.jar.JarOutputStream jar,
int compressionLevel)
Dumps a byte[] array of data to a new entry in a Jar archive |
static void |
jar(java.io.InputStream input,
long length,
java.lang.String name,
java.util.jar.JarOutputStream jar)
Dumps a stream to a new entry in a Jar archive |
static void |
jar(java.io.InputStream input,
long length,
java.lang.String name,
java.util.jar.JarOutputStream jar,
int compressionLevel)
Dumps a stream to a new entry in a Jar archive |
static void |
jar(java.io.InputStream input,
java.lang.String name,
java.util.jar.JarOutputStream jar)
Dumps a stream to a new entry in a Jar archive |
static void |
jar(java.io.InputStream input,
java.lang.String name,
java.util.jar.JarOutputStream jar,
int compressionLevel)
Dumps a stream to a new entry in a Jar archive |
static java.io.InputStream |
preextract(java.io.InputStream data,
java.io.File temporary)
Pre-extracts data. |
static java.io.OutputStream |
putNextEntry(java.util.jar.JarOutputStream jar,
java.lang.String name,
int compressionLevel)
Creates a new entry in a Jar archive |
static byte[] |
readFully(java.io.InputStream input)
Loads a full stream to memory |
static void |
unBufferedDump(java.io.InputStream input,
java.io.OutputStream output)
Deprecated. |
static void |
unBufferedDump(java.io.InputStream input,
java.io.OutputStream output,
long count)
Deprecated. |
static void |
unjar(java.util.jar.JarFile jar,
java.lang.String name,
java.io.File file)
Extracts a whole entry to a file |
static void |
unjar(java.util.jar.JarFile jar,
java.lang.String name,
java.io.OutputStream output)
Extracts a whole entry to a stream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.io.OutputStream NULL_OUTPUT
OutputStream
are simply dropped.
Method Detail |
public static java.io.InputStream getAsStream(java.lang.String content)
String
to a readable stream
public static java.io.InputStream getAsStream(java.lang.String[] lines)
String
s to a readable stream
public static java.lang.String getFromStream(java.io.InputStream stream) throws java.io.IOException
String
java.io.IOException
public static java.lang.String[] getTokens(java.io.InputStream stream, java.lang.String delimiters) throws java.io.IOException
java.io.StreamTokenizer
class.
java.io.IOException
public static java.lang.String getFromStream(java.io.InputStream stream, boolean close) throws java.io.IOException
String
stream
- the stream to read fromclose
- wether to close the input stream once exhausted
java.io.IOException
public static java.io.InputStream preextract(java.io.InputStream data, java.io.File temporary) throws java.io.IOException
data
- the data stream to be pre-extractedtemporary
- the temporary file or directory to pre-extract data into
java.io.IOException
public static java.io.File createTemporaryFile(java.io.File directory) throws java.io.IOException
java.io.IOException
public static java.io.OutputStream putNextEntry(java.util.jar.JarOutputStream jar, java.lang.String name, int compressionLevel) throws java.io.IOException
Jar
archive
jar
- the Jar
archive to write toname
- the Jar
entry name to create, which might include a /
-separated pathcompressionLevel
- the compression level ranging from 0
(no compression) to 9
(best but slowest compression).
OutputStream
to be written into, which automatically closes the underlying entry on close()
Warning: forgetting the close()
call will cause the entry to be closed once in the GC's thread, which
means at non-deterministic points, which might corrupt the underlying ZIP archive.
java.io.IOException
public static void jar(java.io.InputStream input, long length, java.lang.String name, java.util.jar.JarOutputStream jar) throws java.io.IOException
Jar
archive
jar
- the Jar
archive to write toname
- the Jar
entry name to create, which might include a /
-separated path
Data is stored according to the default compression level
java.io.IOException
Settings.Defaults.JAR_COMPRESSION_LEVEL
public static void jar(java.io.InputStream input, long length, java.lang.String name, java.util.jar.JarOutputStream jar, int compressionLevel) throws java.io.IOException
Jar
archive
input
- the input data streamlength
- the expected length of the input streamjar
- the Jar
archive to write toname
- the Jar
entry name to create, which might include a /
-separated pathcompressionLevel
- the compression level ranging from 0
(no compression) to 9
(best but slowest compression).
java.io.IOException
public static void jar(java.io.InputStream input, java.lang.String name, java.util.jar.JarOutputStream jar) throws java.io.IOException
Jar
archive
input
- the input data streamjar
- the Jar
archive to write toname
- the Jar
entry name to create, which might include a /
-separated path
Data is stored according to the default compression level
java.io.IOException
Settings.Defaults.JAR_COMPRESSION_LEVEL
public static void jar(java.io.InputStream input, java.lang.String name, java.util.jar.JarOutputStream jar, int compressionLevel) throws java.io.IOException
Jar
archive
input
- the input data streamjar
- the Jar
archive to write toname
- the Jar
entry name to create, which might include a /
-separated pathcompressionLevel
- the compression level ranging from 0
(no compression) to 9
(best but slowest compression).
java.io.IOException
public static void jar(byte[] data, java.lang.String name, java.util.jar.JarOutputStream jar) throws java.io.IOException
byte[]
array of data to a new entry in a Jar
archive
data
- the input datajar
- the Jar
archive to write toname
- the Jar
entry name to create, which might include a /
-separated path
Data is stored according to the default compression level
java.io.IOException
Settings.Defaults.JAR_COMPRESSION_LEVEL
public static void jar(byte[] data, java.lang.String name, java.util.jar.JarOutputStream jar, int compressionLevel) throws java.io.IOException
byte[]
array of data to a new entry in a Jar
archive
data
- the input datajar
- the Jar
archive to write toname
- the Jar
entry name to create, which might include a /
-separated pathcompressionLevel
- the compression level ranging from 0
(no compression) to 9
(best but slowest compression).
java.io.IOException
public static void unjar(java.util.jar.JarFile jar, java.lang.String name, java.io.File file) throws java.io.IOException
jar
- the jar archivename
- the Jar
entry name to create, which might include a /
-separated pathfile
- the output file
java.io.IOException
public static void unjar(java.util.jar.JarFile jar, java.lang.String name, java.io.OutputStream output) throws java.io.IOException
jar
- the jar archivename
- the Jar
entry name to create, which might include a /
-separated pathoutput
- the output stream
java.io.IOException
public static byte[] readFully(java.io.InputStream input) throws java.io.IOException
input
- the input data stream
byte[]
array of data
java.io.IOException
public static void bufferedDump(java.io.InputStream input, java.io.OutputStream output, long count) throws java.io.IOException
input
- the input data streamoutput
- the output stream
java.io.IOException
public static void unBufferedDump(java.io.InputStream input, java.io.OutputStream output, long count) throws java.io.IOException
input
- the input data streamoutput
- the output stream
java.io.IOException
public static void bufferedDump(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
input
- the input data streamoutput
- the output stream
java.io.IOException
public static void unBufferedDump(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
input
- the input data streamoutput
- the output stream
java.io.IOException
public static void askWetherToRetry(java.io.IOException e) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |