java.lang.Object
org.codelibs.jcifs.smb.internal.smb1.com.LockingAndXRange
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
ConstructorsConstructorDescriptionLockingAndXRange(boolean largeFile) Constructs a LockingAndXRange with large file support. -
Method Summary
Modifier and TypeMethodDescriptionintdecode(byte[] buffer, int bufferIndex, int len) Decode data from a byte bufferintencode(byte[] dst, int dstIndex) Encodes this object into the specified byte array.longReturns the starting byte offset of the lock range.longReturns the byte length of the lock range.intgetPid()Returns the process ID associated with this lock range.intsize()Returns the size in bytes that this object will occupy when encoded.
-
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
Decode data from a byte buffer- Specified by:
decodein interfaceDecodable- Parameters:
buffer- the byte buffer containing the data to decodebufferIndex- the starting index in the bufferlen- 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. -
size
public int size()Returns the size in bytes that this object will occupy when encoded.
-