Package java.nio.channels

Examples of java.nio.channels.FileChannel


      BodyDataSource dataSource = response.getBody();
     
      File tempFile = QAUtil.createTempfile();
       
        RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
        FileChannel fc = raf.getChannel();
       
        dataSource.transferTo(fc);
        fc.close();
        raf.close();
       
        Assert.assertTrue(QAUtil.isEquals(tempFile, file));
        dataSource.close();
     
View Full Code Here


        BodyDataSource dataSource = response.getBody();
       
        File tempFile = QAUtil.createTempfile();
       
        RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
        FileChannel fc = raf.getChannel();
       
        dataSource.transferTo(fc, length);
        fc.close();
        raf.close();
       
        Assert.assertTrue(QAUtil.isEquals(tempFile, file));
        dataSource.close();
       
View Full Code Here

    int contentLength = QAUtil.readContentLength(header);
    File tempFile = QAUtil.createTempfile();
   
    RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
    FileChannel fc = raf.getChannel();
   
    con.transferTo(fc, contentLength);
   
    fc.close();
    raf.close();
   
    Assert.assertTrue(QAUtil.isEquals(file, tempFile));

    tempFile.delete();
View Full Code Here

    Assert.assertEquals(200, response.getStatus());

    File tempFile = QAUtil.createTempfile();
   
    RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
    FileChannel fc = raf.getChannel();
   
    BlockingBodyDataSource source = response.getBlockingBody();
    source.transferTo(fc);
   
    fc.close();
    raf.close();
   
    Assert.assertTrue(QAUtil.isEquals(file, tempFile));

    tempFile.delete();
View Full Code Here

    IHttpResponse response = respHdl.getResponse();
    Assert.assertEquals(200, response.getStatus());

    File tempFile = QAUtil.createTempfile();   
    RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
    FileChannel fc = raf.getChannel();
   
    BlockingBodyDataSource source = response.getBlockingBody();
    source.transferTo(fc);
   
    fc.close();
    raf.close();
   
    Assert.assertTrue(QAUtil.isEquals(file, tempFile));

    QAUtil.sleep(500);
View Full Code Here

        int contentLength = QAUtil.readContentLength(header);
        File tempFile = QAUtil.createTempfile();
       
        RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
        FileChannel fc = raf.getChannel();
       
        con.transferTo(fc, contentLength);
       
        fc.close();
        raf.close();
       
        Assert.assertTrue(QAUtil.isEquals(file, tempFile));

        tempFile.delete();
View Full Code Here

    Assert.assertEquals(200, response.getStatus());

    File tempFile = QAUtil.createTempfile();
   
    RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
    FileChannel fc = raf.getChannel();
   
    BlockingBodyDataSource source = response.getBlockingBody();
    source.transferTo(fc);
   
    fc.close();
    raf.close();
   
    Assert.assertTrue(QAUtil.isEquals(file, tempFile));

    tempFile.delete();
View Full Code Here

    IHttpResponse response = respHdl.getResponse();
    Assert.assertEquals(200, response.getStatus());

    File tempFile = QAUtil.createTempfile();   
    RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
    FileChannel fc = raf.getChannel();
   
    BlockingBodyDataSource source = response.getBlockingBody();
    source.transferTo(fc);
   
    fc.close();
    raf.close();
   
    Assert.assertTrue(QAUtil.isEquals(file, tempFile));

View Full Code Here

      BlockingBodyDataSource dataSource = response.getBlockingBody();
     
      File tempFile = QAUtil.createTempfile();
       
        RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
        FileChannel fc = raf.getChannel();
       
        dataSource.transferTo(fc);
        fc.close();
        raf.close();
       
        Assert.assertTrue(QAUtil.isEquals(tempFile, file));
        dataSource.close();
     
View Full Code Here

        BlockingBodyDataSource dataSource = response.getBlockingBody();
       
        File tempFile = QAUtil.createTempfile();
       
        RandomAccessFile raf = new RandomAccessFile(tempFile, "rw");
        FileChannel fc = raf.getChannel();
       
        dataSource.transferTo(fc, length);
        fc.close();
        raf.close();
       
        Assert.assertTrue(QAUtil.isEquals(tempFile, file));
        dataSource.close();
       
View Full Code Here

TOP

Related Classes of java.nio.channels.FileChannel

Copyright © 2018 www.massapicom. 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.