Module jcifs

Class SmbComReadAndX

All Implemented Interfaces:
CommonServerMessageBlock, CommonServerMessageBlockRequest, CommonServerMessageBlockResponse, RequestWithPath, Message, Request, Response

public class SmbComReadAndX extends AndXServerMessageBlock
SMB1 Read AndX request message. This command is used to read data from a file that has been previously opened with an Open command.
  • Constructor Details

    • SmbComReadAndX

      public SmbComReadAndX(Configuration config)
      Constructs a Read AndX request.
      Parameters:
      config - the configuration
    • SmbComReadAndX

      public SmbComReadAndX(Configuration config, int fid, long offset, int maxCount, ServerMessageBlock andx)
      Constructs a Read AndX request with parameters.
      Parameters:
      config - the configuration
      fid - the file identifier
      offset - the file offset to read from
      maxCount - the maximum number of bytes to read
      andx - the next command in the chain
  • Method Details

    • getMaxCount

      public final int getMaxCount()
      Gets the maximum count of bytes to read.
      Returns:
      the maxCount
    • setMaxCount

      public final void setMaxCount(int maxCount)
      Sets the maximum count of bytes to read.
      Parameters:
      maxCount - the maxCount to set
    • getMinCount

      public final int getMinCount()
      Gets the minimum count of bytes to read.
      Returns:
      the minCount
    • setMinCount

      public final void setMinCount(int minCount)
      Sets the minimum count of bytes to read.
      Parameters:
      minCount - the minCount to set
    • getRemaining

      public final int getRemaining()
      Gets the remaining bytes count.
      Returns:
      the remaining
    • setOpenTimeout

      public final void setOpenTimeout(int openTimeout)
      Sets the open timeout value.
      Parameters:
      openTimeout - the openTimeout to set
    • setRemaining

      public final void setRemaining(int remaining)
      Sets the remaining bytes count.
      Parameters:
      remaining - the remaining to set
    • getBatchLimit

      protected int getBatchLimit(Configuration cfg, byte cmd)
      Description copied from class: AndXServerMessageBlock
      Gets the batch limit for chained commands
      Overrides:
      getBatchLimit in class AndXServerMessageBlock
      Parameters:
      cfg - the configuration
      cmd - the command byte
      Returns:
      the batch limit
    • writeParameterWordsWireFormat

      protected int writeParameterWordsWireFormat(byte[] dst, int dstIndex)
      Description copied from class: ServerMessageBlock
      Writes the parameter words portion of the SMB message to the wire format.
      Specified by:
      writeParameterWordsWireFormat in class ServerMessageBlock
      Parameters:
      dst - the destination buffer
      dstIndex - the starting offset in the buffer
      Returns:
      the number of bytes written
    • writeBytesWireFormat

      protected int writeBytesWireFormat(byte[] dst, int dstIndex)
      Description copied from class: ServerMessageBlock
      Writes the data bytes portion of the SMB message to the wire format.
      Specified by:
      writeBytesWireFormat in class ServerMessageBlock
      Parameters:
      dst - the destination buffer
      dstIndex - the starting offset in the buffer
      Returns:
      the number of bytes written
    • readParameterWordsWireFormat

      protected int readParameterWordsWireFormat(byte[] buffer, int bufferIndex)
      Description copied from class: ServerMessageBlock
      Reads the parameter words portion of the SMB message from the wire format.
      Specified by:
      readParameterWordsWireFormat in class ServerMessageBlock
      Parameters:
      buffer - the buffer containing the message data
      bufferIndex - the starting offset in the buffer
      Returns:
      the number of bytes read
    • readBytesWireFormat

      protected int readBytesWireFormat(byte[] buffer, int bufferIndex)
      Description copied from class: ServerMessageBlock
      Reads the data bytes portion of the SMB message from the wire format.
      Specified by:
      readBytesWireFormat in class ServerMessageBlock
      Parameters:
      buffer - the buffer containing the message data
      bufferIndex - the starting offset in the buffer
      Returns:
      the number of bytes read
    • toString

      public String toString()
      Overrides:
      toString in class AndXServerMessageBlock