Writes the contents of the given PlayerCharacter to a stream author: Thomas Behr 11-03-02 @param pcToBeWritten the PlayerCharacter to write @param out the stream to be written to @deprecated The write to a file method should be used in preference as it has safe backup handling.
(PlayerCharacter pcToBeWritten, GameMode mode, List<Campaign> campaigns, OutputStream out)
| 218 | * @deprecated The write to a file method should be used in preference as it has safe backup handling. |
| 219 | */ |
| 220 | @Deprecated |
| 221 | @Override |
| 222 | public void write(PlayerCharacter pcToBeWritten, GameMode mode, List<Campaign> campaigns, OutputStream out) |
| 223 | { |
| 224 | final String pcgString; |
| 225 | pcgString = (new PCGVer2Creator(pcToBeWritten, mode, campaigns)).createPCGString(); |
| 226 | |
| 227 | try (BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(out, StandardCharsets.UTF_8))) |
| 228 | { |
| 229 | bw.write(pcgString); |
| 230 | bw.flush(); |
| 231 | |
| 232 | pcToBeWritten.setDirty(false); |
| 233 | } catch (IOException ioe) |
| 234 | { |
| 235 | Logging.errorPrint("Exception in PCGIOHandler::write", ioe); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | /** |
| 240 | * Writes the contents of the given PlayerCharacter to a file. This method also includes |
no test coverage detected