added char stream copy.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@3903 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-07-29 17:21:00 +00:00
1 parent 82fe674184
commit d4304e19e4
1 file changed
+9
+9
View File
@@ -15,6 +15,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.security.DigestInputStream;
@@ -248,6 +250,13 @@ public class Util {
out.write(buf,0,len);
}
public static void copyStream(Reader in, Writer out) throws IOException {
char[] buf = new char[8192];
int len;
while((len=in.read(buf))>0)
out.write(buf,0,len);
}
public static String[] tokenize(String s) {
StringTokenizer st = new StringTokenizer(s);
String[] a = new String[st.countTokens()];