java.lang.Object
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Request<Smb2ReadResponse>
org.codelibs.jcifs.smb.internal.smb2.io.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 Summary
FieldsModifier and TypeFieldDescriptionstatic intChannel type for standard read without RDMAstatic intChannel type for RDMA version 1static intChannel type for RDMA version 1 with invalidatestatic byteFlag to indicate unbuffered read operationFields inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
SMB2_CANCEL, SMB2_CHANGE_NOTIFY, SMB2_CLOSE, SMB2_CREATE, SMB2_ECHO, SMB2_FLAGS_ASYNC_COMMAND, SMB2_FLAGS_DFS_OPERATIONS, SMB2_FLAGS_PRIORITY_MASK, SMB2_FLAGS_RELATED_OPERATIONS, SMB2_FLAGS_REPLAY_OPERATION, SMB2_FLAGS_SERVER_TO_REDIR, SMB2_FLAGS_SIGNED, SMB2_FLUSH, SMB2_IOCTL, SMB2_LOCK, SMB2_LOGOFF, SMB2_NEGOTIATE, SMB2_OPLOCK_BREAK, SMB2_QUERY_DIRECTORY, SMB2_QUERY_INFO, SMB2_READ, SMB2_SESSION_SETUP, SMB2_SET_INFO, SMB2_TREE_CONNECT, SMB2_TREE_DISCONNECT, SMB2_WRITE -
Constructor Summary
ConstructorsConstructorDescriptionSmb2ReadRequest(Configuration config, byte[] fileId, byte[] outputBuffer, int outputBufferOffset) Constructs a SMB2 read request with the specified parameters -
Method Summary
Modifier and TypeMethodDescriptionprotected Smb2ReadResponseCreate the response object for this requestprotected intreadBytesWireFormat(byte[] buffer, int bufferIndex) Reads the message body from the wire format.voidsetFileId(byte[] fileId) Sets the file ID for this request.voidsetMinimumCount(int minimumCount) Sets the minimum number of bytes that must be read for the operation to succeedvoidsetOffset(long offset) Sets the file offset from which to start readingvoidsetPadding(byte padding) Sets the padding for the read requestvoidsetReadFlags(byte readFlags) Sets the read flags for the read operationvoidsetReadLength(int readLength) Sets the number of bytes to readvoidsetRemainingBytes(int remainingBytes) Sets the number of bytes remaining to be read after this requestintsize()Gets the size of this message.protected intwriteBytesWireFormat(byte[] dst, int dstIndex) Writes the message body to the wire format.Methods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2Request
allowChain, createCancel, encode, getCreditCost, getNext, getOverrideTimeout, getResponse, ignoreDisconnect, initResponse, isCancel, isResponseAsync, setNext, setOverrideTimeout, setRequestCredits, setResponse, setTid, splitMethods inherited from class org.codelibs.jcifs.smb.internal.smb2.ServerMessageBlock2
addFlags, chain, clearFlags, decode, decode, equals, getAsyncId, getCommand, getConfig, getCredit, getCreditCharge, getDigest, getErrorContextCount, getErrorData, getFlags, getHeaderStart, getLength, getMid, getNextCommandOffset, getRawPayload, getSessionId, getStatus, getTreeId, hashCode, haveResponse, isAsync, isErrorResponseStatus, isRetainPayload, pad8, readErrorResponse, readHeaderWireFormat, reset, retainPayload, setAsyncId, setCommand, setCredit, setDigest, setExtendedSecurity, setMid, setNext, setRawPayload, setReadSize, setSessionId, setTreeId, setUid, size8, size8, toString, writeHeaderWireFormatMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.codelibs.jcifs.smb.internal.CommonServerMessageBlock
decode, getCommand, getDigest, getMid, reset, setCommand, setDigest, setExtendedSecurity, setMid, setSessionId, setUidMethods inherited from interface org.codelibs.jcifs.smb.util.transport.Message
getRawPayload, isRetainPayload, retainPayload, setRawPayload
-
Field Details
-
SMB2_READFLAG_READ_UNBUFFERED
public static byte SMB2_READFLAG_READ_UNBUFFEREDFlag to indicate unbuffered read operation -
SMB2_CHANNEL_NONE
public static int SMB2_CHANNEL_NONEChannel type for standard read without RDMA -
SMB2_CHANNEL_RDMA_V1
public static int SMB2_CHANNEL_RDMA_V1Channel type for RDMA version 1 -
SMB2_CHANNEL_RDMA_V1_INVALIDATE
public static int SMB2_CHANNEL_RDMA_V1_INVALIDATEChannel 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 requestfileId- the file ID to read fromoutputBuffer- the buffer to read data intooutputBufferOffset- the offset in the output buffer to start writing data
-
-
Method Details
-
createResponse
protected Smb2ReadResponse createResponse(CIFSContext tc, ServerMessageBlock2Request<Smb2ReadResponse> req) Description copied from class:ServerMessageBlock2RequestCreate the response object for this request- Specified by:
createResponsein classServerMessageBlock2Request<Smb2ReadResponse>- Parameters:
tc- the CIFS contextreq- the request object- Returns:
- the response object
-
setFileId
public void setFileId(byte[] fileId) Sets the file ID for this request.- Specified by:
setFileIdin interfaceRequestWithFileId- 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:
sizein interfaceCommonServerMessageBlockRequest- 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:
writeBytesWireFormatin classServerMessageBlock2- Parameters:
dst- the destination bufferdstIndex- 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:
readBytesWireFormatin classServerMessageBlock2- Parameters:
buffer- the buffer to read frombufferIndex- the starting position in the buffer- Returns:
- number of bytes read
- See Also:
-