1 | public void exportObject(FileOutputStream outStream, String text)↵ | | 1 | public void exportObject(FileOutputStream outStream, String text)↵
|
2 | throws IOException {↵ | | 2 | throws IOException {↵
|
3 | ↵ | | 3 | ↵
|
4 | OutputStreamWriter outWriter = new OutputStreamWriter(outStream);↵ | | 4 | OutputStreamWriter outWriter = new OutputStreamWriter(outStream);↵
|
5 | ↵ | | 5 | ↵
|
6 | // check that the text is a valid representation↵ | | 6 | // check that the text is a valid representation↵
|
7 | StringBuffer messageBuffer = new StringBuffer();↵ | | 7 | StringBuffer messageBuffer = new StringBuffer();↵
|
8 | validateAndConvertInPopup(text, null, messageBuffer);↵ | | 8 | validateAndConvertInPopup(text, null, messageBuffer);↵
|
9 | if (messageBuffer.length() > 0) {↵ | | 9 | if (messageBuffer.length() > 0) {↵
|
10 | // there was an error in the conversion↵ | | 10 | // there was an error in the conversion↵
|
11 | throw new IOException(new String(messageBuffer));↵ | | 11 | throw new IOException(new String(messageBuffer));↵
|
12 | }↵ | | 12 | }↵
|
13 | ↵ | | 13 | ↵
|
14 | // just send the text to the output file↵ | | 14 | // just send the text to the output file↵
|
15 | outWriter.write(text);↵ | | 15 | outWriter.write(text);↵
|
16 | outWriter.flush();↵ | | 16 | outWriter.flush();↵
|
17 | outWriter.close();↵ | | 17 | outWriter.close();↵
|
18 | | | 18 |
|