Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.arranger.jarl.util
Class IOUtil  view IOUtil download IOUtil.java

java.lang.Object
  extended bycom.arranger.jarl.util.IOUtil

public class IOUtil
extends java.lang.Object

IOUtil handles file saving operations


Field Summary
protected static int DEFAULT_BUF_SIZE
           
protected static java.lang.String m_tempDirectory
           
protected static java.lang.String TEMP_FILENAME_PREFIX
           
 
Constructor Summary
IOUtil()
           
 
Method Summary
static int copyStream(java.io.InputStream inputStream, java.io.OutputStream outputStream)
          Copies all the bits from the inputStream to the ouputStream
static void decompress(java.io.InputStream compressedStream, java.io.OutputStream outputStream)
           
static java.io.InputStream getInputStream(java.lang.String location)
           
static java.io.OutputStream getOutputStream(java.lang.String location)
           
static java.io.Reader getReader(java.lang.String location)
           
static java.lang.String getTempDirectory()
           
static java.lang.String getTempFile(java.lang.String extension)
           
static byte[] getTLSByteArray()
          Get the tls's byte array
static java.io.Writer getWriter(java.lang.String location)
           
static java.awt.Image load(java.io.File file)
           
static java.util.Properties loadProperties(java.lang.String location)
           
static java.lang.String promptForInput(java.lang.String prompt)
          Helper function to promptForInput from System.in
static void save(java.awt.Image image, java.io.File file)
          Saves an image to a file The image should be of the ColorModel: BufferedImage.TYPE_INT_RGB And the file will be saved as a bmp
static void saveJPEG(java.awt.Image image, java.io.File file)
          Writes a jpeg
static byte[] toByteArray(java.io.InputStream inputStream)
           
static byte[] toByteArray(java.lang.String location)
          Get contents of file as a byte array
static byte[] toCompressedByteArray(java.io.InputStream inputStream)
           
static byte[] toCompressedByteArray(java.lang.String location)
          Like toByteArray(java.lang.String) 55 , but uses toCompressedByteArray(java.lang.String) 55
static java.lang.String toString(java.lang.String location)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_BUF_SIZE

protected static final int DEFAULT_BUF_SIZE
See Also:
Constant Field Values

TEMP_FILENAME_PREFIX

protected static final java.lang.String TEMP_FILENAME_PREFIX
See Also:
Constant Field Values

m_tempDirectory

protected static java.lang.String m_tempDirectory
Constructor Detail

IOUtil

public IOUtil()
Method Detail

save

public static void save(java.awt.Image image,
                        java.io.File file)
Saves an image to a file The image should be of the ColorModel: BufferedImage.TYPE_INT_RGB And the file will be saved as a bmp


saveJPEG

public static void saveJPEG(java.awt.Image image,
                            java.io.File file)
Writes a jpeg


load

public static java.awt.Image load(java.io.File file)

getInputStream

public static java.io.InputStream getInputStream(java.lang.String location)
                                          throws java.io.IOException

getOutputStream

public static java.io.OutputStream getOutputStream(java.lang.String location)
                                            throws java.io.IOException

getReader

public static java.io.Reader getReader(java.lang.String location)
                                throws java.io.IOException

getWriter

public static java.io.Writer getWriter(java.lang.String location)
                                throws java.io.IOException

loadProperties

public static java.util.Properties loadProperties(java.lang.String location)
                                           throws java.io.IOException

toString

public static java.lang.String toString(java.lang.String location)
                                 throws java.io.IOException

toByteArray

public static byte[] toByteArray(java.lang.String location)
                          throws java.io.IOException
Get contents of file as a byte array


toCompressedByteArray

public static byte[] toCompressedByteArray(java.lang.String location)
                                    throws java.io.IOException
Like toByteArray(java.lang.String) 55 , but uses toCompressedByteArray(java.lang.String) 55


toByteArray

public static byte[] toByteArray(java.io.InputStream inputStream)
                          throws java.io.IOException

toCompressedByteArray

public static byte[] toCompressedByteArray(java.io.InputStream inputStream)
                                    throws java.io.IOException

decompress

public static void decompress(java.io.InputStream compressedStream,
                              java.io.OutputStream outputStream)
                       throws java.io.IOException

copyStream

public static int copyStream(java.io.InputStream inputStream,
                             java.io.OutputStream outputStream)
                      throws java.io.IOException
Copies all the bits from the inputStream to the ouputStream


getTLSByteArray

public static byte[] getTLSByteArray()
Get the tls's byte array


getTempDirectory

public static java.lang.String getTempDirectory()

getTempFile

public static java.lang.String getTempFile(java.lang.String extension)

promptForInput

public static java.lang.String promptForInput(java.lang.String prompt)
Helper function to promptForInput from System.in