Package org.pentaho.reporting.libraries.base.util

Examples of org.pentaho.reporting.libraries.base.util.MemoryByteArrayOutputStream.toByteArray()


    final MemoryByteArrayOutputStream bout = new MemoryByteArrayOutputStream();
    BundleWriter.writeReportToZipStream(report, bout);
    final ResourceManager mgr = new ResourceManager();
    mgr.registerDefaults();

    final Resource resource = mgr.createDirectly(bout.toByteArray(), MasterReport.class);
    return (MasterReport) resource.getResource();
  }
}
View Full Code Here


    // clear all report properties, which may cause trouble ...
    final MemoryByteArrayOutputStream bo = new MemoryByteArrayOutputStream();
    final ObjectOutputStream oout = new ObjectOutputStream(bo);
    oout.writeObject(report);
    oout.close();
    return bo.toByteArray();
  }

  private MasterReport deserializeReportObject(final byte[] data) throws IOException, ClassNotFoundException
  {
    final ByteArrayInputStream bin = new ByteArrayInputStream(data);
View Full Code Here

    // clear all report properties, which may cause trouble ...
    final MemoryByteArrayOutputStream bo = new MemoryByteArrayOutputStream();
    final ObjectOutputStream oout = new ObjectOutputStream(bo);
    oout.writeObject(report);
    oout.close();
    return bo.toByteArray();
  }

  private MasterReport deserializeReportObject(final byte[] data) throws IOException, ClassNotFoundException
  {
    final ByteArrayInputStream bin = new ByteArrayInputStream(data);
View Full Code Here

    final FileOutputStream outputStream = new FileOutputStream(f);
    outputStream.write(bout.toByteArray());
    outputStream.close();
*/
    final ResourceManager mgr = new ResourceManager();
    final Resource reportRes = mgr.createDirectly(bout.toByteArray(), MasterReport.class);
    return (MasterReport) reportRes.getResource();
  }

  @Test
  public void testExecuteReports() throws Exception
View Full Code Here

    }
    finally
    {
      outputStream.close();
    }
    return (outputStream.toByteArray());
  }

  public static void createXmlPageable(final MasterReport report)
      throws Exception
  {
View Full Code Here

                                   final float quality,
                                   final boolean alpha) throws UnsupportedEncoderException, IOException
  {
    final MemoryByteArrayOutputStream byteOut = new MemoryByteArrayOutputStream(65536, 65536 * 2);
    encodeImage(byteOut, image, mimeType, quality, alpha);
    return byteOut.toByteArray();
  }

  public static void encodeImage(final OutputStream outputStream,
                                 final Image image,
                                 final String mimeType,
View Full Code Here

        new MemoryByteArrayOutputStream(Math.min(1024 * 1024, (int) goldSample.length()), 1024 * 1024);

    try
    {
      IOUtils.getInstance().copyStreams(goldInput, goldByteStream);
      goldData = goldByteStream.toByteArray();
      if (Arrays.equals(goldData, reportOutput))
      {
        return;
      }
    }
View Full Code Here

    }
    finally
    {
      outputStream.close();
    }
    return (outputStream.toByteArray());
  }

  protected byte[] executeTableFlow(final MasterReport report)
      throws IOException, ReportProcessingException
  {
View Full Code Here

    }
    finally
    {
      outputStream.close();
    }
    return (outputStream.toByteArray());
  }

  protected byte[] executePageable(final MasterReport report)
      throws IOException, ReportProcessingException
  {
View Full Code Here

      final MemoryByteArrayOutputStream bout = new MemoryByteArrayOutputStream();
      BundleWriter.writeReportToZipStream(report, bout);
      final ResourceManager mgr = new ResourceManager();
      mgr.registerDefaults();

      final Resource resource = mgr.createDirectly(bout.toByteArray(), MasterReport.class);
      final MasterReport r2 = (MasterReport) resource.getResource();
      final SubReport sr2 = r2.getReportHeader().getSubReport(0);
      final DataFactory e2 = sr2.getDataFactory();
      assertNotNull(e2); // cannot assert equals, as this is not implemented ...
      initializeDataFactory(e2);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.