I am trying read a text file and insert those content into database. My file.length() is 3540 But the byte array is full of zeros. As a result when I open the text file, it is empty.
File file = new File("/temp/abc.txt");
byte[] bytesArray = new byte[(int) file.length()];
databaseBean.setContentInByteArray(bytesArray);
Here the byteArray is full of zeroes.