tcl.lang.channel
Class Fcopy

java.lang.Object
  extended by tcl.lang.channel.Fcopy

public class Fcopy
extends Object

This class implements an efficient copy between Channels

Author:
Dan Bodoh

Constructor Summary
Fcopy(Interp interp, Channel source, Channel destination, long size, String callback)
          Create a new Fcopy object.
 
Method Summary
 long getWrittenByteCount()
           
 long start()
          Start the copy process.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Fcopy

public Fcopy(Interp interp,
             Channel source,
             Channel destination,
             long size,
             String callback)
      throws TclException
Create a new Fcopy object. This constructor does not start the copy process.

Parameters:
interp - The current interpreter
source - the source Channel
destination - the destination Channel
size - number of bytes to write to the destination; if < 0 writing takes place to EOF on source
callback - if null, return when copy is complete; if non-null, perform the copy in the background and call script in TclObject when copy is complete
Throws:
TclException
Method Detail

getWrittenByteCount

public long getWrittenByteCount()
Returns:
the number of bytes written to the destination

start

public long start()
           throws TclException
Start the copy process. If a callback was provided in the constructor, start() returns immediately. Otherwise, it waits for the copy to cmoplete.

Returns:
number of bytes written to the destination, if a callback was not provided.
Throws:
TclException
IOException


Copyright © 2015. All rights reserved.