Class ChunkedPacket

java.lang.Object
eu.cloudnetservice.driver.network.protocol.BasePacket
eu.cloudnetservice.driver.impl.network.chunk.network.ChunkedPacket
All Implemented Interfaces:
eu.cloudnetservice.driver.network.protocol.Packet

public final class ChunkedPacket extends eu.cloudnetservice.driver.network.protocol.BasePacket
A transfer packet that holds data about a chunk of data to transfer.
Since:
4.0
  • Field Summary

    Fields inherited from class eu.cloudnetservice.driver.network.protocol.BasePacket

    channel, creationStamp, dataBuf, prioritized, uniqueId
  • Constructor Summary

    Constructors
    Constructor
    Description
    ChunkedPacket(@NonNull eu.cloudnetservice.driver.network.buffer.DataBuf dataBuf)
    Constructs a new chunked transfer part packet.
  • Method Summary

    Modifier and Type
    Method
    Description
    static eu.cloudnetservice.driver.network.buffer.DataBuf.Mutable
    createBaseChunkDataBuffer(int chunkIndex, @NonNull eu.cloudnetservice.driver.network.chunk.ChunkSessionInformation sessionInfo)
    Creates the base chunk data buffer for transferring a chunk of data.

    Methods inherited from class eu.cloudnetservice.driver.network.protocol.BasePacket

    canEqual, channel, constructResponse, content, creation, equals, hashCode, prioritized, readable, toString, uniqueId, uniqueId

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • ChunkedPacket

      public ChunkedPacket(@NonNull @NonNull eu.cloudnetservice.driver.network.buffer.DataBuf dataBuf)
      Constructs a new chunked transfer part packet.
      Parameters:
      dataBuf - the data for the handling process of the chunk part.
      Throws:
      NullPointerException - if the given buffer is null.
  • Method Details

    • createBaseChunkDataBuffer

      @NonNull public static eu.cloudnetservice.driver.network.buffer.DataBuf.Mutable createBaseChunkDataBuffer(int chunkIndex, @NonNull @NonNull eu.cloudnetservice.driver.network.chunk.ChunkSessionInformation sessionInfo)
      Creates the base chunk data buffer for transferring a chunk of data.
      Parameters:
      chunkIndex - the 0-based index of the chunk that is being sent.
      sessionInfo - the information about the transfer session that this packet is related to.
      Returns:
      a full chunk packet containing all the information provided to this method.
      Throws:
      NullPointerException - if the given source data or chunk information is null.