Module tdlight.api

Class TdApi.ReadFilePart

Enclosing class:
TdApi

public static final class TdApi.ReadFilePart extends TdApi.Function<TdApi.FilePart>
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 final int
    Identifier uniquely determining type of the object.
    long
    Number of bytes to read.
    int
    Identifier of the file.
    long
    The offset from which to read the file.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Reads a part of a file from the TDLib file cache and returns read bytes.
    ReadFilePart(int fileId, long offset, long count)
    Reads a part of a file from the TDLib file cache and returns read bytes.
    Reads a part of a file from the TDLib file cache and returns read bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    Returns an identifier uniquely determining type of the object.
    int
     
    void
    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. The file must be located in the TDLib file cache.
    • offset

      public long offset
      The offset from which to read the file.
    • count

      public long 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
      Identifier uniquely determining type of the object.
      See Also:
  • 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, long offset, long 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 - Identifier of the file. The file must be located in the TDLib file cache.
      offset - The offset from which to read the file.
      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.

      Returns FilePart

    • ReadFilePart

      public ReadFilePart(DataInput input) throws IOException
      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:
      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