public class Test{
public static void main(String[] args){
char[] data={a,b,c};
String s=new String(data);
System.out.println(s);
}
}
package cn.rg.demo.test;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
public class writeFile {
public static void main(String[] args) throws IOException {
BufferedInputStream in = new BufferedInputStream(new FileInputStream("C:/Documents and Settings/iwin/桌面/work/ff85c21a4810499abc09854397b85c47.html"));
ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
System.out.println("Available bytes:" + in.available());
byte[] temp = new byte[1024];
int size = 0;
while ((size = in.read(temp)) != -1) {
out.write(temp, 0, size);
}
in.close();
byte[] content = out.toByteArray();
String s=new String(content);
System.out.println(s);
System.out.println("Readed bytes count:" + content.length);
}
}
public static void main(String[] args){
char[] data={a,b,c};
String s=new String(data);
System.out.println(s);
}
}
package cn.rg.demo.test;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;
public class writeFile {
public static void main(String[] args) throws IOException {
BufferedInputStream in = new BufferedInputStream(new FileInputStream("C:/Documents and Settings/iwin/桌面/work/ff85c21a4810499abc09854397b85c47.html"));
ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
System.out.println("Available bytes:" + in.available());
byte[] temp = new byte[1024];
int size = 0;
while ((size = in.read(temp)) != -1) {
out.write(temp, 0, size);
}
in.close();
byte[] content = out.toByteArray();
String s=new String(content);
System.out.println(s);
System.out.println("Readed bytes count:" + content.length);
}
}