import java.io.File;このコードを実行すると、次のようになります:
public class main
{
public static void main(String[] args)
{
File file =new File("C:\\test.avi");
if(file.exists()){
double bytes = file.length();
倍精度ビット = バイト * 8;
ダブルキロバイト = バイト / 1024;
ダブルメガバイト = キロバイト / 1024;
ダブルギガバイト = メガバイト / 1024;
ダブルテラバイト = ギガバイト / 1024;
System.out.println("ビット: " + ビット + "ビット");
System.out.println("バイト: " + バイト+ " バイト");
System.out.println("キロバイト: " + キロバイト+ "KB");
System.out.println("メガバイト: " + メガバイト + "MB");
System.out.println("ギガバイト: " + ギガバイト + "GB");
System.out.println("テラバイト: " + テラバイト + "宛先");
}else{
System.out.println("存在しないファイル");
}
}
}
bits: 4.624187392E9 bits参照:
bytes: 5.78023424E8 bytes
キロバイト: 564476.0KB
メガバイト: 551.24609375MB
ギガバイト: 0.5383262634277344GB
テラバイト:5.257092416286469E-4TB
Please disable your ad blocker and refresh the window to use this website.