File content is not read completely

Asked

Viewed 35 times

1

I am with a case where the contents of the file is not read whole, only part of it. Follow the example:

I performed the test to see if the file was correct on the device opening it without using totalcross and the file is complete.

If you need a copy of the file I send by e-mail. It has: 20k.

public class DSINTesteMainWindow extends MainWindow {

public DSINTesteMainWindow()
{
    super("Teste", Window.NO_BORDER);

    Convert.setDefaultConverter("UTF8");
}

public void initUI()
{

    try {
        Vm.debug(new String(new File("/sdcard/dsin/20170526143838985", File.READ_ONLY).readAndClose()));
    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}}
  • please send me this file by email. I will see here some alternatives to get around this issue in the meantime

  • I figured out what’s going on: the method File.read is not blocking, just like the other methods that depend on it: readAndClose() and readAndDelete(). This means that large readings may not be performed in a single pass. These methods will be deprecated. I’m posting a more consistent alternative answer

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.