Discovering Streams in an Application


This example demonstrates how to find Streams of different types in an Application.

// Look up all streaming factories
StreamPrintServiceFactory[] factories
    = StreamPrintServiceFactory.lookupStreamPrintServiceFactories(null, null);

// Find all streaming factories that support particular input formats;
// in this case, GIF and postscript
factories = StreamPrintServiceFactory.lookupStreamPrintServiceFactories(

// Use a factory to create a print service.
// An output stream is required to create a print service.
OutputStream fos = new BufferedOutputStream(
    new FileOutputStream(""));
StreamPrintService service = factories[0].getPrintService(fos);


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.