0

Please refer to the image below and clarify me what is the root cause for this. While windows explorer shows correct file size, JFileChooser shows wrong size. I am telling file chooser is wrong because txt file is 0 byte file which I created, but file chooser shows 1kb for the same.

enter image description here

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Dilanka M
  • 372
  • 1
  • 5
  • 17

1 Answers1

1

Notice that the size of the same file in each of the two listings differs by 1 KB. Windows includes the file's metadata, like they talk about here, but JFileChooser includes just the length() of the file's content.

Catalina Island
  • 7,027
  • 2
  • 23
  • 42