Back to project page Spidermine.
The source code is released under:
Copyright ? 2014 PEMapModder This software is open-source and everyone is welcome to share redistributions or modifications, as long as it is clearly specified that this project's original source is ...
If you think the Android project Spidermine listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package pemapmodder.old_spidermine.utils.io; /*from w w w. ja va 2 s . co m*/ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; public class MyReader extends FileInputStream { public MyReader(File f) throws FileNotFoundException { super(f); } public String readLength(int length) throws IOException{ String o=""; for(int i=0;i<length;i++) o+=(char)read(); return o; } public String readAll() throws NullPointerException, IOException, IndexOutOfBoundsException{ String ret=""; for(int c=read(); c!=-1; c=read()) ret+=(char)c; return ret; } /** * * @param file * @return all contents * @throws FileNotFoundException * @throws NullPointerException * @throws IndexOutOfBoundsException * @throws IOException */ public static String readAll(File f) throws FileNotFoundException, NullPointerException, IndexOutOfBoundsException, IOException{ MyReader mr=new MyReader(f); String all=mr.readAll(); mr.close(); return all; } }