Module jcifs

Class Smb2ReadRequest

All Implemented Interfaces:
CommonServerMessageBlock, CommonServerMessageBlockRequest, Request<Smb2ReadResponse>, RequestWithFileId, Message, Request

public class Smb2ReadRequest extends ServerMessageBlock2Request<Smb2ReadResponse> implements RequestWithFileId
SMB2 Read request message. This command is used to read data from a file that has been previously opened with a Create request.
Author:
mbechler
  • Field Details

    • SMB2_READFLAG_READ_UNBUFFERED

      public static byte SMB2_READFLAG_READ_UNBUFFERED
      Flag to indicate unbuffered read operation
    • SMB2_CHANNEL_NONE

      public static int SMB2_CHANNEL_NONE
      Channel type for standard read without RDMA
    • SMB2_CHANNEL_RDMA_V1

      public static int SMB2_CHANNEL_RDMA_V1
      Channel type for RDMA version 1
    • SMB2_CHANNEL_RDMA_V1_INVALIDATE

      public static int SMB2_CHANNEL_RDMA_V1_INVALIDATE
      Channel type for RDMA version 1 with invalidate
  • Constructor Details

    • Smb2ReadRequest

      public Smb2ReadRequest(Configuration config, byte[] fileId, byte[] outputBuffer, int outputBufferOffset)
      Constructs a SMB2 read request with the specified parameters
      Parameters:
      config - the configuration to use for this request
      fileId - the file ID to read from
      outputBuffer - the buffer to read data into
      outputBufferOffset - the offset in the output buffer to start writing data
  • Method Details

    • createResponse

      Description copied from class: ServerMessageBlock2Request
      Create the response object for this request
      Specified by:
      createResponse in class ServerMessageBlock2Request<Smb2ReadResponse>
      Parameters:
      tc - the CIFS context
      req - the request object
      Returns:
      the response object
    • setFileId

      public void setFileId(byte[] fileId)
      Sets the file ID for this request.
      Specified by:
      setFileId in interface RequestWithFileId
      Parameters:
      fileId - the file ID to set
      See Also:
    • setPadding

      public void setPadding(byte padding)
      Sets the padding for the read request
      Parameters:
      padding - the padding to set
    • setReadFlags

      public void setReadFlags(byte readFlags)
      Sets the read flags for the read operation
      Parameters:
      readFlags - the readFlags to set
    • setReadLength

      public void setReadLength(int readLength)
      Sets the number of bytes to read
      Parameters:
      readLength - the readLength to set
    • setOffset

      public void setOffset(long offset)
      Sets the file offset from which to start reading
      Parameters:
      offset - the offset to set
    • setMinimumCount

      public void setMinimumCount(int minimumCount)
      Sets the minimum number of bytes that must be read for the operation to succeed
      Parameters:
      minimumCount - the minimumCount to set
    • setRemainingBytes

      public void setRemainingBytes(int remainingBytes)
      Sets the number of bytes remaining to be read after this request
      Parameters:
      remainingBytes - the remainingBytes to set
    • size

      public int size()
      Gets the size of this message.
      Specified by:
      size in interface CommonServerMessageBlockRequest
      Returns:
      the size of this message
      See Also:
    • writeBytesWireFormat

      protected int writeBytesWireFormat(byte[] dst, int dstIndex)
      Writes the message body to the wire format.
      Specified by:
      writeBytesWireFormat in class ServerMessageBlock2
      Parameters:
      dst - the destination buffer
      dstIndex - the starting position in the buffer
      Returns:
      number of bytes written
      See Also:
    • readBytesWireFormat

      protected int readBytesWireFormat(byte[] buffer, int bufferIndex)
      Reads the message body from the wire format.
      Specified by:
      readBytesWireFormat in class ServerMessageBlock2
      Parameters:
      buffer - the buffer to read from
      bufferIndex - the starting position in the buffer
      Returns:
      number of bytes read
      See Also: