01: package gnu.mapping;
02:
03: import java.io.*;
04:
05: /**
06: * Similar to CharArrayWriter.
07: */
08:
09: public class CharArrayOutPort extends OutPort {
10: public CharArrayOutPort() {
11: super (null, false, "<string>");
12: }
13:
14: public char[] toCharArray() {
15: int length = bout.bufferFillPointer;
16: char[] result = new char[length];
17: System.arraycopy(bout.buffer, 0, result, 0, length);
18: return result;
19: }
20: }
|