FileDocCategorySizeDatePackage
TransactNamedPipeOutputStream.javaAPI DocJCIFS 1.3.17 API2753Tue Oct 18 15:26:24 BST 2011jcifs.smb

TransactNamedPipeOutputStream

public class TransactNamedPipeOutputStream extends SmbFileOutputStream

Fields Summary
private String
path
private SmbNamedPipe
pipe
private byte[]
tmp
private boolean
dcePipe
Constructors Summary
TransactNamedPipeOutputStream(SmbNamedPipe pipe)


          
        super(pipe, false, (pipe.pipeType & 0xFFFF00FF) | SmbFile.O_EXCL);
        this.pipe = pipe;
        this.dcePipe = ( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_DCE_TRANSACT ) == SmbNamedPipe.PIPE_TYPE_DCE_TRANSACT;
        path = pipe.unc;
    
Methods Summary
public voidclose()

        pipe.close();
    
public voidwrite(int b)

        tmp[0] = (byte)b;
        write( tmp, 0, 1 );
    
public voidwrite(byte[] b)

        write( b, 0, b.length );
    
public voidwrite(byte[] b, int off, int len)

        if( len < 0 ) {
            len = 0;
        }

        if(( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_CALL ) == SmbNamedPipe.PIPE_TYPE_CALL ) {
            pipe.send( new TransWaitNamedPipe( path ),
                                        new TransWaitNamedPipeResponse() );
            pipe.send( new TransCallNamedPipe( path, b, off, len ),
                                        new TransCallNamedPipeResponse( pipe ));
        } else if(( pipe.pipeType & SmbNamedPipe.PIPE_TYPE_TRANSACT ) ==
                                                    SmbNamedPipe.PIPE_TYPE_TRANSACT ) {
            ensureOpen();
            TransTransactNamedPipe req = new TransTransactNamedPipe( pipe.fid, b, off, len );
            if (dcePipe) {
                req.maxDataCount = 1024;
            }
            pipe.send( req, new TransTransactNamedPipeResponse( pipe ));
        }