# TdApi.ReadFilePart (tdlight API 3.3.160 API)
declaration: package: it.tdlight.jni, class: TdApi, class: ReadFilePart

Package it.tdlight.jni

# Class TdApi.ReadFilePart

java.lang.Object
it.tdlight.jni.TdApi.Object
it.tdlight.jni.TdApi.Function
it.tdlight.jni.TdApi.ReadFilePart

Enclosing class:
  TdApi

    public static class TdApi.ReadFilePart
    extends TdApi.Function

Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file.

Returns `FilePart`

## Field Summary

Fields
Modifier and Type | Field | Description
--- | --- | ---
`static int` | `CONSTRUCTOR` |
`int` | `count` | Number of bytes to read.
`int` | `fileId` | Identifier of the file.
`int` | `offset` | The offset from which to read the file.

## Constructor Summary

Constructors
Constructor | Description
--- | ---
`ReadFilePart()` | Reads a part of a file from the TDLib file cache and returns read bytes.
`ReadFilePart​(int fileId, int offset, int count)` | Reads a part of a file from the TDLib file cache and returns read bytes.
`ReadFilePart​(DataInput input)` |

## Method Summary

Modifier and Type | Method | Description
--- | --- | ---
`boolean` | `equals​(Object o)` |
`int` | `getConstructor()` |
`int` | `hashCode()` |
`void` | `serialize​(DataOutput output)` |

### 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

`getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### fileId

public int fileId
Identifier of the file. The file must be located in the TDLib file cache.

### offset

public int offset
The offset from which to read the file.

### count

public int count
Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position.

### CONSTRUCTOR

public static final int CONSTRUCTOR

See Also:
  Constant Field Values

## Constructor Details

### ReadFilePart

public ReadFilePart()
Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file.

Returns `FilePart`

### ReadFilePart

public ReadFilePart​(int fileId, int offset, int count)
Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file.

Returns `FilePart`

Parameters:
  `fileId` - int Identifier of the file. The file must be located in the TDLib file cache.
  `offset` - int The offset from which to read the file.
  `count` - int Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position.

### ReadFilePart

public ReadFilePart​(DataInput input) throws IOException

Throws:
  `IOException`

## Method Details

### getConstructor

public int getConstructor()

Specified by:
  `getConstructor` in class `TdApi.Object`

### serialize

public void serialize​(DataOutput output) throws IOException

Specified by:
  `serialize` in class `TdApi.Object`
Throws:
  `IOException`

### equals

public boolean equals​(Object o)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`