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
  • 263,859
  • 56
  • 671
  • 702
Vitaliy
  • 59
  • 1
  • 5

1 Answers1

9

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

byteArray.length;

And

1kb = 1024 bytes
Sibbo
  • 3,689
  • 2
  • 23
  • 40
Suresh Atta
  • 118,038
  • 37
  • 189
  • 297