FileDocCategorySizeDatePackage
SmbComTransactionResponse.javaAPI DocJCIFS 1.3.17 API6268Tue Oct 18 15:26:24 BST 2011jcifs.smb

SmbComTransactionResponse

public abstract class SmbComTransactionResponse extends ServerMessageBlock implements Enumeration

Fields Summary
private static final int
SETUP_OFFSET
private static final int
DISCONNECT_TID
private static final int
ONE_WAY_TRANSACTION
private int
pad
private int
pad1
private boolean
parametersDone
private boolean
dataDone
protected int
totalParameterCount
protected int
totalDataCount
protected int
parameterCount
protected int
parameterOffset
protected int
parameterDisplacement
protected int
dataOffset
protected int
dataDisplacement
protected int
setupCount
protected int
bufParameterStart
protected int
bufDataStart
int
dataCount
byte
subCommand
boolean
hasMore
boolean
isPrimary
byte[]
txn_buf
int
status
int
numEntries
FileEntry[]
results
Constructors Summary
SmbComTransactionResponse()


     
        txn_buf = null;
    
Methods Summary
public booleanhasMoreElements()

        return errorCode == 0 && hasMore;
    
public java.lang.ObjectnextElement()

        if( isPrimary ) {
            isPrimary = false;
        }
        return this;
    
intreadBytesWireFormat(byte[] buffer, int bufferIndex)

        pad = pad1 = 0;
        int n;

        if( parameterCount > 0 ) {
            bufferIndex += pad = parameterOffset - ( bufferIndex - headerStart );
            System.arraycopy( buffer, bufferIndex, txn_buf,
                            bufParameterStart + parameterDisplacement, parameterCount );
            bufferIndex += parameterCount;
        }
        if( dataCount > 0 ) {
            bufferIndex += pad1 = dataOffset - ( bufferIndex - headerStart );
            System.arraycopy( buffer, bufferIndex, txn_buf,
                            bufDataStart + dataDisplacement, dataCount );
            bufferIndex += dataCount;
        }

        /* Check to see if the entire transaction has been
         * read. If so call the read methods.
         */

        if( !parametersDone &&
                ( parameterDisplacement + parameterCount ) == totalParameterCount) {
            parametersDone = true;
        }

        if( !dataDone && ( dataDisplacement + dataCount ) == totalDataCount) {
            dataDone = true;
        }

        if( parametersDone && dataDone ) {
            hasMore = false;
            readParametersWireFormat( txn_buf, bufParameterStart, totalParameterCount );
            readDataWireFormat( txn_buf, bufDataStart, totalDataCount );
        }

        return pad + parameterCount + pad1 + dataCount;
    
abstract intreadDataWireFormat(byte[] buffer, int bufferIndex, int len)

intreadParameterWordsWireFormat(byte[] buffer, int bufferIndex)

        int start = bufferIndex;

        totalParameterCount = readInt2( buffer, bufferIndex );
        if( bufDataStart == 0 ) {
            bufDataStart = totalParameterCount;
        }
        bufferIndex += 2;
        totalDataCount = readInt2( buffer, bufferIndex );
        bufferIndex += 4; // Reserved
        parameterCount = readInt2( buffer, bufferIndex );
        bufferIndex += 2;
        parameterOffset = readInt2( buffer, bufferIndex );
        bufferIndex += 2;
        parameterDisplacement = readInt2( buffer, bufferIndex );
        bufferIndex += 2;
        dataCount = readInt2( buffer, bufferIndex );
        bufferIndex += 2;
        dataOffset = readInt2( buffer, bufferIndex );
        bufferIndex += 2;
        dataDisplacement = readInt2( buffer, bufferIndex );
        bufferIndex += 2;
        setupCount = buffer[bufferIndex] & 0xFF;
        bufferIndex += 2;
        if( setupCount != 0 ) {
            if( log.level > 2 )
                log.println( "setupCount is not zero: " + setupCount );
        }

        return bufferIndex - start;
    
abstract intreadParametersWireFormat(byte[] buffer, int bufferIndex, int len)

abstract intreadSetupWireFormat(byte[] buffer, int bufferIndex, int len)

voidreset()

        super.reset();
        bufDataStart = 0;
        isPrimary = hasMore = true; 
        parametersDone = dataDone = false;
    
public java.lang.StringtoString()

        return new String( super.toString() +
            ",totalParameterCount=" + totalParameterCount +
            ",totalDataCount=" + totalDataCount +
            ",parameterCount=" + parameterCount +
            ",parameterOffset=" + parameterOffset +
            ",parameterDisplacement=" + parameterDisplacement +
            ",dataCount=" + dataCount +
            ",dataOffset=" + dataOffset +
            ",dataDisplacement=" + dataDisplacement +
            ",setupCount=" + setupCount +
            ",pad=" + pad +
            ",pad1=" + pad1 );
    
intwriteBytesWireFormat(byte[] dst, int dstIndex)

        return 0;
    
abstract intwriteDataWireFormat(byte[] dst, int dstIndex)

intwriteParameterWordsWireFormat(byte[] dst, int dstIndex)

        return 0;
    
abstract intwriteParametersWireFormat(byte[] dst, int dstIndex)

abstract intwriteSetupWireFormat(byte[] dst, int dstIndex)