Module tdlight.api
Package it.tdlight.jni

# Class TdApi.DownloadFile

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.Function<TdApi.File>
it.tdlight.jni.TdApi.DownloadFile

Enclosing class:
  TdApi

public static final class TdApi.DownloadFile extends TdApi.Function<TdApi.File>
Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates.

Returns `File`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`CONSTRUCTOR`
Identifier uniquely determining type of the object.
`int`
`fileId`
Identifier of the file to download.
`long`
`limit`
Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit.
`long`
`offset`
The starting position from which the file needs to be downloaded.
`int`
`priority`
Priority of the download (1-32).
`boolean`
`synchronous`
Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started.

## Constructor Summary

Constructors
Constructor
Description
`DownloadFile()`
Downloads a file from the cloud.
`DownloadFile(int fileId, int priority, long offset, long limit, boolean synchronous)`
Downloads a file from the cloud.
`DownloadFile(DataInput input)`
Downloads a file from the cloud.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object o)`
`int`
`getConstructor()`
Returns an identifier uniquely determining type of the object.
`int`
`hashCode()`
`void`
`serialize(DataOutput output)`
Serialize the TDLib class

### Methods inherited from class it.tdlight.jni.TdApi.Function

`toString`

### Methods inherited from class it.tdlight.jni.TdApi.Object

`serialize`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### fileId

public int fileId
Identifier of the file to download.

### priority

public int priority
Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first.

### offset

public long offset
The starting position from which the file needs to be downloaded.

### limit

public long limit
Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit.

### synchronous

public boolean synchronous
Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started.

### CONSTRUCTOR

public static final int CONSTRUCTOR
Identifier uniquely determining type of the object.

See Also:
  - Constant Field Values

## Constructor Details

### DownloadFile

public DownloadFile()
Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates.

Returns `File`

### DownloadFile

public DownloadFile(int fileId, int priority, long offset, long limit, boolean synchronous)
Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates.

Returns `File`

Parameters:
  `fileId` - Identifier of the file to download.
  `priority` - Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first.
  `offset` - The starting position from which the file needs to be downloaded.
  `limit` - Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit.
  `synchronous` - Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started.

  Returns `File`

### DownloadFile

public DownloadFile(DataInput input) throws IOException
Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates.

Returns `File`

Parameters:
  `input` - Serialized input
Throws:
  `IOException` - the deserialization failed

## Method Details

### getConstructor

public int getConstructor()
Description copied from class: `TdApi.Object`
Returns an identifier uniquely determining type of the object.

Specified by:
  `getConstructor` in class `TdApi.Object`
Returns:
  this.CONSTRUCTOR

### serialize

public void serialize(DataOutput output) throws IOException
Serialize the TDLib class

Specified by:
  `serialize` in class `TdApi.Object`
Parameters:
  `output` - output data stream
Throws:
  `IOException` - the serialization failed

### equals

public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`