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

Receive file question #60

Open
jaspm2004 opened this issue Dec 6, 2013 · 0 comments
Open

Receive file question #60

jaspm2004 opened this issue Dec 6, 2013 · 0 comments

Comments

@jaspm2004
Copy link

Hi there, me again.

Im testing the receiveFile(file, 0, file_size) method but i cant get it working.

        // Receive the file length, in bytes
        byte[] buffer = new byte[8];
        receiver.receive(buffer);
        log("file size = " + toLong(buffer));
        long file_size = toLong(buffer);

        // receive the file...
        File file = new File("C:\\temp\\udtfile.tar.gz");
        receiver.receiveFile(file, 0, file_size);

First it was not working because seems that its not enough to create a new File(), the file have to exists before on the folder. I created the file by hand then.

Second, seems the file_size have to match the real file size? how it is this possible? i have to copy raw data to the file until reach the file_size parameter?

Ill appreciate some help on this, thanks in advance....

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