T
Timo Nentwig
Hi!
final File fin = new File( args[ 0 ] );
final File fout = new File( args[ 1 ] );
final FileChannel in = new FileInputStream( fin ).getChannel();
final FileChannel out = new
FileOutputStream( fout ).getChannel();
final ByteBuffer buf = ByteBuffer.allocate( 2048 );
int j;
j = in.read( buf, seek_header );
System.out.println("read: " + j);
j = out.write( buf );
System.out.println("written: " + j);
This outputs:
read: 2048
written: 0
Why doesn't it write the data? The new file is created but nothing is
written in to it.
final File fin = new File( args[ 0 ] );
final File fout = new File( args[ 1 ] );
final FileChannel in = new FileInputStream( fin ).getChannel();
final FileChannel out = new
FileOutputStream( fout ).getChannel();
final ByteBuffer buf = ByteBuffer.allocate( 2048 );
int j;
j = in.read( buf, seek_header );
System.out.println("read: " + j);
j = out.write( buf );
System.out.println("written: " + j);
This outputs:
read: 2048
written: 0
Why doesn't it write the data? The new file is created but nothing is
written in to it.