Update of /cvsroot/krysalis/krysalis-version/src/main/org/krysalis/version/util/io
In directory sc8-pr-cvs1:/tmp/cvs-serv6646/src/main/org/krysalis/version/util/io
Added Files:
IOUtils.java
Log Message:
Start on environment analysis (comparison against a fixed base)
--- NEW FILE: IOUtils.java ---
package org.krysalis.version.util.io;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
import java.io.Writer;
public class IOUtils {
public static void transfer(InputStream input, OutputStream output)
throws IOException {
// Transfer the bytes in blocks..
byte b[] = new byte[1000];
int numRead = -1;
do {
numRead = input.read(b);
if (numRead != -1)
output.write(b, 0, numRead);
}
while (numRead != -1);
}
public static void close(Reader reader) {
if (null != reader) {
try {
reader.close();
}
catch (Exception e) {
}
}
}
public static void close(InputStream stream) {
if (null != stream) {
try {
stream.close();
}
catch (Exception e) {
}
}
}
public static void close(Writer writer) {
if (null != writer) {
try {
writer.close();
}
catch (Exception e) {
}
}
}
public static void close(OutputStream stream) {
if (null != stream) {
try {
stream.close();
}
catch (Exception e) {
}
}
}
}
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.