Bookmark Topic Watch Topic
  • New Topic

how to get the bytes required to load a file in memory?  RSS feed

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Report post to moderator
how to get the bytes required to load a file in memory?
or,
how to caculate the number of bytes the file takes to load in memory?
 
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Report post to moderator
You need to get familiar with the java.io.File class - for example the length() method. It is important to note that this will give the size of the byte[] that will hold the data, NOT the size if you read the file as characters.

Bill
 
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
UseOneThreadPerQuestion. Continuing in this thread.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!