Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MatFileReader Problems When Building in Netbeans #4

Open
sevenstarknight opened this issue Apr 6, 2016 · 0 comments
Open

MatFileReader Problems When Building in Netbeans #4

sevenstarknight opened this issue Apr 6, 2016 · 0 comments

Comments

@sevenstarknight
Copy link

I'm getting a "URI is not hierarchical" error when I try building in Netbeans, and use a .mat file as a resource.

This isn't so much as problem with JMatIO as it is a problem with not excepting InputStream as an input to the reader, and using a .mat file as a resource. I've had to do the following:

MatFileReader reader = new MatFileReader();

    InputStream inStream = this.getClass().getResourceAsStream(
            "/filename.mat);

    try {
        //==============================================================
        // temp fix to accomdate JMatIO
        File tempFile = File.createTempFile("mat2File", ".tmp");
        tempFile.deleteOnExit();
        FileOutputStream out = new FileOutputStream(tempFile);
        IOUtils.copy(inStream, out);

        //===============================================================
        Map<String, MLArray> dataFromFile = reader.read(tempFile);

to get around the problem, I thought you might want to do something similar (but in the JMatIO code base)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant