File: GrowWrite.java

package info (click to toggle)
jcifs 1.3.16-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,856 kB
  • sloc: java: 23,124; xml: 3,663; ansic: 386; sh: 170; makefile: 26
file content (30 lines) | stat: -rw-r--r-- 821 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import jcifs.smb.SmbFile;
import jcifs.smb.SmbFileOutputStream;
import java.io.FileInputStream;

public class GrowWrite {

    static final int SIZE = 0xFFF;

    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." );
    }
}