Package messages

Class FileMessage

All Implemented Interfaces:
Serializable

public class FileMessage extends AbstractMessage
The successor class AbstractMessage, is a Data Transfer Object, designed to transfer bytes of a file.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    byte[]
    Bytes of the file.
    The file name.
    int
    The number of the current part of the file.
    int
    Number is an indicator of how many parts a file is cut into in total.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FileMessage(String filename, int partNumber, int partsCount, byte[] data)
    When creating a message containing file data, the following is determined: file name, the assigned parcel number, how many parcels there are in total, and the byte array itself containing part of the file.
  • Method Summary

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • filename

      public String filename
      The file name.
    • partNumber

      public int partNumber
      The number of the current part of the file. (Parts of the size of the transmitted information do not exceed 10 mb).
    • partsCount

      public int partsCount
      Number is an indicator of how many parts a file is cut into in total.
    • data

      public byte[] data
      Bytes of the file. Array no more than 10 mb.
  • Constructor Details

    • FileMessage

      public FileMessage(String filename, int partNumber, int partsCount, byte[] data)
      When creating a message containing file data, the following is determined: file name, the assigned parcel number, how many parcels there are in total, and the byte array itself containing part of the file.
      Parameters:
      filename - The file name.
      partNumber - The assigned parcel number.
      partsCount - How many packages are there in total.
      data - An array of bytes containing a part of the file.