MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / toByteArray

Method toByteArray

ij/src/main/java/ij/gui/Plot.java:424–434  ·  view source on GitHub ↗

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).

()

Source from the content-addressed store, hash-verified

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() {

Callers 15

saveAsTiffMethod · 0.95
serializeMethod · 0.95
saveAsZipMethod · 0.95
build.gradle.ktsFile · 0.45
saveMPTableMethod · 0.45
openZipMethod · 0.45
addPlotMethod · 0.45
prependPlotMethod · 0.45
testFillFileDataStepMethod · 0.45
doCompressedImageTestMethod · 0.45

Calls 3

toStreamMethod · 0.95
handleExceptionMethod · 0.95
closeMethod · 0.65

Tested by 15

testFillFileDataStepMethod · 0.36
doCompressedImageTestMethod · 0.36
doTestM13RealRiceMethod · 0.36
doTestFZStepMethod · 0.36
decompressMethod · 0.36
testNullDataInfoMethod · 0.36
dumpHeaderTestsMethod · 0.36
testNoSkipStreamMethod · 0.36
testFitsUndefinedHdu4Method · 0.36