1 18 19 package jcifs.smb; 20 21 import jcifs.Config; 22 23 class SmbComReadAndX extends AndXServerMessageBlock { 24 25 private static final int BATCH_LIMIT = Config.getInt( "jcifs.smb.client.ReadAndX.Close", 1 ); 26 27 private long offset; 28 private int fid, 29 openTimeout; 30 int maxCount, minCount, remaining; 31 32 SmbComReadAndX() { 33 super( null ); 34 command = SMB_COM_READ_ANDX; 35 openTimeout = 0xFFFFFFFF; 36 } 37 SmbComReadAndX( int fid, long offset, int maxCount, ServerMessageBlock andx ) { 38 super( andx ); 39 this.fid = fid; 40 this.offset = offset; 41 this.maxCount = minCount = maxCount; 42 command = SMB_COM_READ_ANDX; 43 openTimeout = 0xFFFFFFFF; 44 } 45 46 void setParam( int fid, long offset, int maxCount ) { 47 this.fid = fid; 48 this.offset = offset; 49 this.maxCount = minCount = maxCount; 50 } 51 int getBatchLimit( byte command ) { 52 return command == SMB_COM_CLOSE ? BATCH_LIMIT : 0; 53 } 54 int writeParameterWordsWireFormat( byte[] dst, int dstIndex ) { 55 int start = dstIndex; 56 57 writeInt2( fid, dst, dstIndex ); 58 dstIndex += 2; 59 writeInt4( offset, dst, dstIndex ); 60 dstIndex += 4; 61 writeInt2( maxCount, dst, dstIndex ); 62 dstIndex += 2; 63 writeInt2( minCount, dst, dstIndex ); 64 dstIndex += 2; 65 writeInt4( openTimeout, dst, dstIndex ); 66 dstIndex += 4; 67 writeInt2( remaining, dst, dstIndex ); 68 dstIndex += 2; 69 writeInt4( offset >> 32, dst, dstIndex ); 70 dstIndex += 4; 71 72 return dstIndex - start; 73 } 74 int writeBytesWireFormat( byte[] dst, int dstIndex ) { 75 return 0; 76 } 77 int readParameterWordsWireFormat( byte[] buffer, int bufferIndex ) { 78 return 0; 79 } 80 int readBytesWireFormat( byte[] buffer, int bufferIndex ) { 81 return 0; 82 } 83 public String toString() { 84 return new String ( "SmbComReadAndX[" + 85 super.toString() + 86 ",fid=" + fid + 87 ",offset=" + offset + 88 ",maxCount=" + maxCount + 89 ",minCount=" + minCount + 90 ",openTimeout=" + openTimeout + 91 ",remaining=" + remaining + 92 ",offset=" + offset + 93 "]" ); 94 } 95 } 96 | Popular Tags |