clipboard.setContents(selection, this);
}
public void paste(Clipboard clipboard) {
if (clipboard == null) return;
Transferable t = clipboard.getContents(this);
try {
/*
InputStream is =
(InputStream)t.getTransferData(DataFlavor.plainTextFlavor);
if(debug > 0)
System.out.println("Clipboard: available: "+is.available());
byte buffer[] = new byte[is.available()];
is.read(buffer);
is.close();
*/
byte buffer[] =
((String) t.getTransferData(DataFlavor.stringFlavor)).getBytes();
try {
write(buffer);
} catch (IOException e) {
reader = null;
}