Symbian
Symbian OS Library

FAQ-0274 ClipBoard.getContents() truncates data. Why?

[Index][spacer] [Previous] [Next]



 

Classification: Java Category: AWT
Created: 09/22/99 Modified: 06/22/2001
Number: FAQ-0274
Platform: ER5

Question:
When I use ClipBoard.getContents() to recover data from the system clipboard, I find the data is truncated at 256 bytes. Why is this and what can I do about it?

Answer:
This is a defect in the current implementation of the EPOC Runtime for Java. The reason the problem occurs is as follows. Because the data on the clipboard is of indeterminate length it is stored in a segmented buffer, each of the segments being 256 bytes. If the data is pasted from the clipboard to, say, a TextComponent with ctrl-v, there is no problem as this is handled directly by the standard EIKON mechanism. But if instead the ClipBoard.getContents() method is used, the clipboard data gets stored via a native method in an EPOC CPlainText. The mechanism employed to recover the data from there is flawed and only reads the contents of the first segment.
There is no known work around for this problem at the moment short of copying the data to and from the clipboard in chunks of not more than 256 bytes.