Writes this plot into a byte array containing (1) the serialized PlotProperties and (2) the serialized Vector of all 'added' PlotObjects. The plot should have been drawn already. Returns null on error (which should never happen).
()
| 422 | * (2) the serialized Vector of all 'added' PlotObjects. |
| 423 | * The plot should have been drawn already. Returns null on error (which should never happen). */ |
| 424 | public byte[] toByteArray() { |
| 425 | try { |
| 426 | ByteArrayOutputStream bos = new ByteArrayOutputStream(); |
| 427 | toStream(bos); |
| 428 | bos.close(); |
| 429 | return bos.toByteArray(); |
| 430 | } catch (Exception e) { |
| 431 | IJ.handleException(e); |
| 432 | return null; |
| 433 | } |
| 434 | } |
| 435 | |
| 436 | /** Returns the title of the image showing the plot (if any) or title of the plot */ |
| 437 | public String getTitle() { |