0

I have byte array, how to know file size ? (in JAVA)

File file = new File("patch");
file.length() // <--- it's good, but I haven't original file... (( I get file in bytes from DataBase !

Thanks

Sotirios Delimanolis
  • 274,122
  • 60
  • 696
  • 724
Vitaliy
  • 59
  • 1
  • 1
  • 5

1 Answers1

11

You have an array with you and every array has a length. That's it.

byteArray.length;

And

1kb = 1024 bytes
Sibbo
  • 3,796
  • 2
  • 23
  • 41
Suresh Atta
  • 120,458
  • 37
  • 198
  • 307