KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > qa > form > VisualDevelopmentUtil


1 package org.netbeans.qa.form;
2
3 import java.io.*;
4
5 public class VisualDevelopmentUtil {
6     
7     public static String JavaDoc readFromFile(String JavaDoc filename) throws IOException {
8         File f = new File(filename);
9         int size = (int) f.length();
10         int bytes_read = 0;
11         FileInputStream in = new FileInputStream(f);
12         byte[] data = new byte [size];
13         while(bytes_read < size)
14             bytes_read += in.read(data, bytes_read, size-bytes_read);
15         return new String JavaDoc(data);
16     }
17     
18 }
19
Popular Tags