Examples of transferTo()


Examples of net.sf.laja.example.account.behaviour.SourceAccount.transferTo()

        System.out.println("=== before transaction ===");
        System.out.println(sourceAccount);
        System.out.println(destinationAccount);

        System.out.println("\n=== transfer 400 ===");
        sourceAccount.transferTo(destinationAccount, 400);

        System.out.println("\n=== after transaction ===");
        System.out.println(sourceAccount);
        System.out.println(destinationAccount);
    }
View Full Code Here

Examples of org.geowebcache.io.Resource.transferTo()

        Resource data = tl.getFeatureInfo(gfiConv, bbox, height, width, x, y);

        try {
            tile.servletResp.setContentType(mimeType.getMimeType());
            ServletOutputStream outputStream = tile.servletResp.getOutputStream();
            data.transferTo(Channels.newChannel(outputStream));
            outputStream.flush();
        } catch (IOException ioe) {
            tile.servletResp.setStatus(500);
            log.error(ioe.getMessage());
        }
View Full Code Here

Examples of org.jboss.netty.channel.FileRegion.transferTo()

                try {
                    synchronized (out) {
                        WritableByteChannel  bchannel = Channels.newChannel(out);
                       
                        long i = 0;
                        while ((i = fr.transferTo(bchannel, length)) > 0) {
                            length += i;
                            if (length >= fr.getCount()) {
                                break;
                            }
                        }
View Full Code Here

Examples of org.jboss.netty.channel.socket.nio.SocketSendBufferPool.SendBuffer.transferTo()

                ChannelFuture future = evt.getFuture();
                try {
                    long localWrittenBytes = 0;
                    for (int i = writeSpinCount; i > 0; i --) {
                        localWrittenBytes = buf.transferTo(ch);
                        if (localWrittenBytes != 0) {
                            writtenBytes += localWrittenBytes;
                            break;
                        }
                        if (buf.finished()) {
View Full Code Here

Examples of org.springframework.web.multipart.MultipartFile.transferTo()

    protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
        FileUploadForm form = (FileUploadForm) command;
        String uploadDir = form.getUploadDir();
        MultipartFile file = form.getFile();
       
        file.transferTo(new File(uploadDir + File.separator + file.getOriginalFilename()));
       
        return new AjaxModelAndView(this.getSuccessView(), errors);
    }
}
View Full Code Here

Examples of org.xsocket.connection.BlockingConnection.transferTo()

        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));
View Full Code Here

Examples of org.xsocket.connection.BlockingConnection.transferTo()

    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));
View Full Code Here

Examples of org.xsocket.connection.BlockingConnection.transferTo()

    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));
View Full Code Here

Examples of org.xsocket.connection.BlockingConnection.transferTo()

        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));
View Full Code Here

Examples of org.xsocket.connection.BlockingConnection.transferTo()

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