src/share/classes/javax/print/Doc.java

Print this page




 151      *          to obtain all attribute values from the job's attribute
 152      *          set.
 153      */
 154     public DocAttributeSet getAttributes();
 155 
 156     /**
 157      * Obtains a reader for extracting character print data from this doc.
 158      * The Doc implementation is required to support this method if the
 159      * DocFlavor has one of the following print data representation classes,
 160      * and return null otherwise:
 161      * <UL>
 162      * <LI> char[]
 163      * <LI> java.lang.String
 164      * <LI> java.io.Reader
 165      * </UL>
 166      * The doc's print data representation object is used to construct and
 167      * return a Reader for reading the print data as a stream of characters
 168      * from the print data representation object.
 169      * However, if the print data representation object is itself a Reader,
 170      * then the print data representation object is simply returned.
 171      * <P>
 172      * @return  Reader for reading the print data characters from this doc.
 173      *          If a reader cannot be provided because this doc does not meet
 174      *          the criteria stated above, null is returned.
 175      *
 176      * @exception  IOException
 177      *     Thrown if there was an I/O error while creating the reader.
 178      */
 179     public Reader getReaderForText() throws IOException;
 180 
 181     /**
 182      * Obtains an input stream for extracting byte print data from this
 183      * doc.  The Doc implementation is required to support this method if
 184      * the DocFlavor has one of the following print data representation
 185      * classes, and return null otherwise:
 186      * <UL>
 187      * <LI> byte[]
 188      * <LI> java.io.InputStream
 189      * </UL>
 190      * This doc's print data representation object is obtained, then an input
 191      * stream for reading the print data from the print data representation
 192      * object as a stream of bytes is created and returned. However, if the
 193      * print data representation object is itself an input stream, then the
 194      * print data representation object is simply returned.
 195      * <P>
 196      * @return  Input stream for reading the print data bytes from this doc. If
 197      *          an input stream cannot be provided because this doc does not
 198      *          meet the criteria stated above, null is returned.
 199      *
 200      * @exception  IOException
 201      *     Thrown if there was an I/O error while creating the input stream.
 202      */
 203     public InputStream getStreamForBytes() throws IOException;
 204 
 205 }


 151      *          to obtain all attribute values from the job's attribute
 152      *          set.
 153      */
 154     public DocAttributeSet getAttributes();
 155 
 156     /**
 157      * Obtains a reader for extracting character print data from this doc.
 158      * The Doc implementation is required to support this method if the
 159      * DocFlavor has one of the following print data representation classes,
 160      * and return null otherwise:
 161      * <UL>
 162      * <LI> char[]
 163      * <LI> java.lang.String
 164      * <LI> java.io.Reader
 165      * </UL>
 166      * The doc's print data representation object is used to construct and
 167      * return a Reader for reading the print data as a stream of characters
 168      * from the print data representation object.
 169      * However, if the print data representation object is itself a Reader,
 170      * then the print data representation object is simply returned.
 171      *
 172      * @return  Reader for reading the print data characters from this doc.
 173      *          If a reader cannot be provided because this doc does not meet
 174      *          the criteria stated above, null is returned.
 175      *
 176      * @exception  IOException
 177      *     Thrown if there was an I/O error while creating the reader.
 178      */
 179     public Reader getReaderForText() throws IOException;
 180 
 181     /**
 182      * Obtains an input stream for extracting byte print data from this
 183      * doc.  The Doc implementation is required to support this method if
 184      * the DocFlavor has one of the following print data representation
 185      * classes, and return null otherwise:
 186      * <UL>
 187      * <LI> byte[]
 188      * <LI> java.io.InputStream
 189      * </UL>
 190      * This doc's print data representation object is obtained, then an input
 191      * stream for reading the print data from the print data representation
 192      * object as a stream of bytes is created and returned. However, if the
 193      * print data representation object is itself an input stream, then the
 194      * print data representation object is simply returned.
 195      *
 196      * @return  Input stream for reading the print data bytes from this doc. If
 197      *          an input stream cannot be provided because this doc does not
 198      *          meet the criteria stated above, null is returned.
 199      *
 200      * @exception  IOException
 201      *     Thrown if there was an I/O error while creating the input stream.
 202      */
 203     public InputStream getStreamForBytes() throws IOException;
 204 
 205 }