Examples of SmbFileOutputStream


Examples of jcifs.smb.SmbFileOutputStream

    /**
     * Creates an output stream to write the file content to.
     */
    protected OutputStream doGetOutputStream(boolean bAppend) throws Exception
    {
        return new SmbFileOutputStream(file, bAppend);
    }
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

            boolean outflag = false;

            if(outfile.startsWith("smb://"))
            {
                outflag = true;
                out = new BufferedOutputStream(new SmbFileOutputStream(new SmbFile(outfile,
                                                                                   getAuth())));
            }
            else
            {
                out = new BufferedOutputStream(new FileOutputStream(outfile));
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

        try
        {
            file = toSMB(file);

            out = new BufferedOutputStream(new SmbFileOutputStream(new SmbFile(file,
                                                                               getAuth())));
            in = new BufferedInputStream(i);

            byte[] buf = new byte[smbBuffer];
            int len = 0;
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

public class CreateFile {

    public static void main( String argv[] ) throws Exception {

        SmbFileOutputStream out = new SmbFileOutputStream( argv[0], false );
        out.close();
    }
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

public class Append {

    public static void main( String argv[] ) throws Exception {

        SmbFile f = new SmbFile( argv[0] );
        SmbFileOutputStream out = new SmbFileOutputStream( f, true );

        byte[] msg;
        int i = 0;
        while( i++ < 3 ) {
            msg = new String( "this is msg #" + i ).getBytes();
            out.write( msg );
            System.out.write( msg );
            Thread.sleep( 10000 );
//out = new SmbFileOutputStream( f, true );
        }

        out.close();
    }
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

    public static void main( String argv[] ) throws Exception {

        SmbFile f = new SmbFile( argv[0] );
        FileInputStream in = new FileInputStream( f.getName() );
        SmbFileOutputStream out = new SmbFileOutputStream( f );

        long t0 = System.currentTimeMillis();

        byte[] b = new byte[8192];
        int n, tot = 0;
        while(( n = in.read( b )) > 0 ) {
            out.write( b, 0, n );
            tot += n;
            System.out.print( '#' );
        }

        long t = System.currentTimeMillis() - t0;

        System.out.println();
        System.out.println( tot + " bytes transfered in " + ( t / 1000 ) + " seconds at " + (( tot / 1000 ) / Math.max( 1, ( t / 1000 ))) + "Kbytes/sec" );

        in.close();
        out.close();
    }
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

import jcifs.smb.SmbFileOutputStream;

public class OpenExclusive {

    public static void main( String argv[] ) throws Exception {
        SmbFileOutputStream out;
        SmbFile f = new SmbFile( argv[0], "", null, SmbFile.FILE_NO_SHARE );
        out = new SmbFileOutputStream( f );
System.in.read();
        out.close();
System.in.read();
// OR
        out = new SmbFileOutputStream( argv[1], SmbFile.FILE_NO_SHARE );
System.in.read();
        out.close();
System.in.read();
    }
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

public class SlowWrite {

    public static void main( String argv[] ) throws Exception {

        SmbFileOutputStream out = new SmbFileOutputStream( argv[0] );

        for( int i = 0; i < 2; i++ ) {
            out.write( (new String( "hello" + i )).getBytes() );
            Thread.sleep( 17000 );
        }

        out.close();
    }
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

    public static void main( String argv[] ) throws Exception {
        int n, tot;
        byte[] buf = new byte[SIZE];
        SmbFile f = new SmbFile( argv[0] );
        SmbFileOutputStream out = new SmbFileOutputStream( f );

        n = tot = 0;
        do {
            if(( n % 0x1F ) == 0) {
                f = new SmbFile( argv[0] );
                out = new SmbFileOutputStream( f );
                System.out.print( '#' );
            }
            out.write( buf, 0, n );
            out.flush();
            tot += n;
        } while( n++ < SIZE );

        System.out.println();
        System.out.println( tot + " bytes transfered." );
View Full Code Here

Examples of jcifs.smb.SmbFileOutputStream

     * Creates an output stream to write the file content to.
     */
    @Override
    protected OutputStream doGetOutputStream(boolean bAppend) throws Exception
    {
        return new SmbFileOutputStream(file, bAppend);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.