Package messages
Class FileMessage
java.lang.Object
messages.AbstractMessage
messages.FileMessage
- All Implemented Interfaces:
Serializable
The successor class
AbstractMessage, is a
Data Transfer Object, designed to transfer bytes of a file.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionbyte[]Bytes of the file.The file name.intThe number of the current part of the file.intNumber is an indicator of how many parts a file is cut into in total. -
Constructor Summary
ConstructorsConstructorDescriptionFileMessage(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
-
Field Details
-
filename
The file name. -
partNumber
public int partNumberThe number of the current part of the file. (Parts of the size of the transmitted information do not exceed 10 mb). -
partsCount
public int partsCountNumber is an indicator of how many parts a file is cut into in total. -
data
public byte[] dataBytes of the file. Array no more than 10 mb.
-
-
Constructor Details
-
FileMessage
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.
-