Examples of transferTo()


Examples of com.facebook.presto.jdbc.internal.netty.channel.FileRegion.transferTo()

                try {
                    synchronized (out) {
                        WritableByteChannel  bchannel = Channels.newChannel(out);

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

Examples of com.facebook.presto.jdbc.internal.netty.channel.socket.nio.SocketSendBufferPool.SendBuffer.transferTo()

                        buf = channel.currentWriteBuffer;
                    }

                    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 com.firefly.net.buffer.SocketSendBufferPool.SendBuffer.transferTo()

                        break;
                    }

                    long localWrittenBytes;
                    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 com.firefly.net.tcp.ssl.SSLSession.transferTo()

          + "Content-Length: " + length + "\r\n"
          + "\r\n")
        .getBytes("UTF-8");
     
      c.write(ByteBuffer.wrap(head));
      c.transferTo((FileChannel)message, 0, length);
    }
  }

}
View Full Code Here

Examples of io.netty.channel.FileRegion.transferTo()

            FileRegion fr = (FileRegion) originalMessage;
            WritableByteChannel bchannel = new ChannelWritableByteChannel(ctx, e);

            int length = 0;
            long i = 0;
            while ((i = fr.transferTo(bchannel, length)) > 0) {
                length += i;
                if (length >= fr.getCount()) {
                    break;
                }
            }
View Full Code Here

Examples of io.netty.channel.sctp.SctpSendBufferPool.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 io.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 java.nio.channels.FileChannel.transferTo()

                dos.writeBoolean(true);
                handler.writeAdditionalHeader(dos);
            }

            // send file using zero-copy send
            nbytes = fc.transferTo(fromPos, xferBytes, channel);
            if(LOG.isDebugEnabled()) {
                LOG.debug("Sent a file '" + file.getAbsolutePath() + "' of " + nbytes
                        + " bytes to " + dstSockAddr.toString() + " in " + sw.toString());
            }
View Full Code Here

Examples of java.nio.channels.FileChannel.transferTo()

        FileInputStream fis = new FileInputStream(f);
        FileChannel in = fis.getChannel();
        WritableByteChannel out = Channels.newChannel(response.getOutputStream());
        try {
          in.transferTo(0, in.size(), out);
          service.removeFile(id);
        } catch (Exception e) {
          throw e;
        } finally {
          in.close();
View Full Code Here

Examples of java.nio.channels.FileChannel.transferTo()

      File bakFile = new File(javaFile.getAbsolutePath()+".bak");
      FileOutputStream fos = new FileOutputStream(bakFile);
      fos.write(DEFAULT_HEADER.getBytes());
      FileChannel fc = raf.getChannel();
      long count = raf.length() - endOfHeader;
      fc.transferTo(endOfHeader, count, fos.getChannel());
      fc.close();
      fos.close();
      raf.close();
      if( javaFile.delete() == false )
         log.severe("Failed to delete java file: "+javaFile);
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.