Module jcifs

Class LockingAndXRange

java.lang.Object
org.codelibs.jcifs.smb.internal.smb1.com.LockingAndXRange
All Implemented Interfaces:
Decodable, Encodable

public class LockingAndXRange extends Object implements Encodable, Decodable
Represents a byte range for SMB1 locking and unlocking operations. This class encapsulates the information about a byte range that needs to be locked or unlocked, including the process ID, offset, and length.
Author:
mbechler
  • Constructor Summary

    Constructors
    Constructor
    Description
    LockingAndXRange(boolean largeFile)
    Constructs a LockingAndXRange with large file support.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    decode(byte[] buffer, int bufferIndex, int len)
    Decode data from a byte buffer
    int
    encode(byte[] dst, int dstIndex)
    Encodes this object into the specified byte array.
    long
    Returns the starting byte offset of the lock range.
    long
    Returns the byte length of the lock range.
    int
    Returns the process ID associated with this lock range.
    int
    Returns the size in bytes that this object will occupy when encoded.

    Methods inherited from class java.lang.Object

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

    • LockingAndXRange

      public LockingAndXRange(boolean largeFile)
      Constructs a LockingAndXRange with large file support.
      Parameters:
      largeFile - whether to use large file support (64-bit offsets)
  • Method Details

    • getPid

      public int getPid()
      Returns the process ID associated with this lock range.
      Returns:
      the process ID
    • getByteOffset

      public long getByteOffset()
      Returns the starting byte offset of the lock range.
      Returns:
      the starting byte offset
    • getLengthInBytes

      public long getLengthInBytes()
      Returns the byte length of the lock range.
      Returns:
      the byte length of the range
    • decode

      public int decode(byte[] buffer, int bufferIndex, int len) throws SMBProtocolDecodingException
      Decode data from a byte buffer
      Specified by:
      decode in interface Decodable
      Parameters:
      buffer - the byte buffer containing the data to decode
      bufferIndex - the starting index in the buffer
      len - the maximum length of data to decode
      Returns:
      decoded length
      Throws:
      SMBProtocolDecodingException - if decoding fails
      See Also:
    • encode

      public int encode(byte[] dst, int dstIndex)
      Encodes this object into the specified byte array.
      Specified by:
      encode in interface Encodable
      Parameters:
      dst - the destination byte array to encode into
      dstIndex - the starting index in the destination array
      Returns:
      encoded length
      See Also:
    • size

      public int size()
      Returns the size in bytes that this object will occupy when encoded.
      Specified by:
      size in interface Encodable
      Returns:
      the encoded size
      See Also: