Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.IOException;
- import java.nio.charset.Charset;
- import java.nio.file.Files;
- import java.nio.file.Paths;
- import java.util.List;
- public class m2 {
- static public void main( String args[] ) throws Exception
- {
- try {
- String filename = "C:\\Temp\\beanshell-DAT.java\\dat_xxx.dat";
- System.out.println(Files.size(Paths.get(filename)));
- List<String> lines = Files.readAllLines(Paths.get(filename), Charset.forName("Cp1250"));
- System.out.println(lines.size()+" "+lines.toString().length());
- byte[] bytes = Files.readAllBytes(Paths.get(filename));
- System.out.println(bytes.length);
- System.out.print("Press ENTER..."); System.in.read();
- }
- catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement