[Vala] Downloading only a portion in the latter part of a file from internet
- From: Arvind Arvind Pro <arvind_dev arvind pro>
- To: vala-list gnome org
- Subject: [Vala] Downloading only a portion in the latter part of a file from internet
- Date: Wed, 28 Aug 2019 14:19:10 +0530
Hi
I want to use Vala code to download only a portion in the latter part of a file from internet-
This is the code I have worked on so far-
var file = File.new_for_uri (url);
var file_stream = file.read ();
var data_stream = new DataInputStream (file_stream);
data_stream.skip (offset);
singlelineofdata = file_stream.read ( offset, 80, 1);
What I want to know is this- offset is the number of bytes within the file, after which I want to download
the remaining content.
Is the above code correct? Because skip should either mean that the content being skipped has already being
downloaded, whereas I wish to
download the portion after the offset. (A random number of bytes for this example). If the above is not
correct then what is the correct way of doing this.
Yours sincerely,
Arvind.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]