com.isti.util
Class PatchManifest

java.lang.Object
  extended by com.isti.util.PatchManifest

public class PatchManifest
extends java.lang.Object


Field Summary
protected static int STREAM_TRANSFER_BUFFER_SIZE
           
 
Constructor Summary
PatchManifest()
           
 
Method Summary
static void main(java.lang.String[] args)
           
static byte[] readFileToBuffer(java.lang.String fileNameStr)
          Reads data from a file into a buffer.
static byte[] readStreamToBuffer(java.io.InputStream stmObj)
          Reads data from an input stream into a byte array.
static void transferStream(java.io.InputStream inputStreamObj, java.io.OutputStream outputStreamObj)
          Transfers data from the input stream to the output stream.
static void writeBufferToFile(java.lang.String fileNameStr, byte[] btArr)
          Writes a data buffer to a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STREAM_TRANSFER_BUFFER_SIZE

protected static int STREAM_TRANSFER_BUFFER_SIZE
Constructor Detail

PatchManifest

public PatchManifest()
Method Detail

main

public static void main(java.lang.String[] args)

readFileToBuffer

public static byte[] readFileToBuffer(java.lang.String fileNameStr)
                               throws java.io.FileNotFoundException,
                                      java.io.IOException
Reads data from a file into a buffer.

Parameters:
fileNameStr - the name of the input file.
Returns:
A byte array containing the contents of the file.
Throws:
java.io.FileNotFoundException - if the specified file is not found.
java.io.IOException - if an error occurred while opening or reading from the input file.

readStreamToBuffer

public static byte[] readStreamToBuffer(java.io.InputStream stmObj)
                                 throws java.io.IOException
Reads data from an input stream into a byte array. The stream is expected to provide characters organized into one or more lines.

Parameters:
stmObj - the input stream to use.
Returns:
A byte array containing the contents of the file.
Throws:
java.io.IOException - if an error occurred while reading from the input stream.

transferStream

public static void transferStream(java.io.InputStream inputStreamObj,
                                  java.io.OutputStream outputStreamObj)
                           throws java.io.IOException
Transfers data from the input stream to the output stream.

Parameters:
inputStreamObj - the input stream.
outputStreamObj - the output stream.
Throws:
java.io.IOException - if an I/O error occurs.

writeBufferToFile

public static void writeBufferToFile(java.lang.String fileNameStr,
                                     byte[] btArr)
                              throws java.io.IOException
Writes a data buffer to a file. Any previous contents in the file are overritten.

Parameters:
fileNameStr - the name of the output file.
btArr - the data to be written.
Throws:
java.io.IOException - if an error occurred while opening or writing to the output file.