PROXY  WHOIS  RQUOTE  TEXTS  SOFT  FOREX  BBOARD
 Music  Philosophy  Code  Literature  Russian

= ROOT|Technical|Code_Examples|Java|javax|print|DocFlavor.java =

page 2 of 15



 * end-of-stream. The bytes are encoded in the character set specified by the 
 * doc flavor's MIME type. If the MIME type does not specify a character set, 
 * the default character set is US-ASCII. 

 * <LI>
 * Uniform Resource Locator ({@link java.net.URL URL})
 * -- The print data consists of the bytes read from the URL location.
 * The bytes are encoded in the character set specified by the doc flavor's
 * MIME type. If the MIME type does not specify a character set, the default
 * character set is US-ASCII. 
 * <P>
 * When the representation class is a URL, the print service itself accesses
 * and downloads the document directly from its URL address, without involving
 * the client. The service may be some form of network print service which
 * is executing in a different environment.
 * This means you should not use a URL print data flavor to print a 
 * document at a restricted URL that the client can see but the printer cannot 
 * see. This also means you should not use a URL print data flavor to print a 
 * document stored in a local file that is not available at a URL
 * accessible independently of the client.
 * For example, a file that is not served up by an HTTP server or FTP server.
 * To print such documents, let the client open an input stream on the URL
 * or file and use an input stream data flavor.
 * </UL>
 * <p>
 * <HR>
 * <h3>Default and Platform Encodings</h3>
 * <P>
 * For byte print data where the doc flavor's MIME type does not include a 
 * <CODE>charset</CODE> parameter, the Java Print Service instance assumes the 
 * US-ASCII character set by default. This is in accordance with
 * <A HREF="http://www.ietf.org/rfc/rfc2046.txt">RFC 2046</A>, which says the 
 * default character set is US-ASCII. Note that US-ASCII is a subset of
 * UTF-8, so in the future this may be widened if a future RFC endorses
 * UTF-8 as the default in a compatible manner.
 * <p>
 * Also note that this is different than the behaviour of the Java runtime 
 * when interpreting a stream of bytes as text data. That assumes the
 * default encoding for the user's locale. Thus, when spooling a file in local
 * encoding to a Java Print Service it is important to correctly specify
 * the encoding. Developers working in the English locales should
 * be particularly conscious of this, as their platform encoding corresponds
 * to the default mime charset. By this coincidence that particular
 * case may work without specifying the encoding of platform data.
 * <p>
 * Every instance of the Java virtual machine has a default character encoding
 * determined during virtual-machine startup and typically depends upon the
 * locale and charset being used by the underlying operating system. 
 * In a distributed environment there is no gurantee that two VM's share
 * the same default encoding. Thus clients which want to stream platform
 * encoded text data from the host platform to a Java Print Service instance
 * must explicitly declare the charset and not rely on defaults.
 * <p>
 * The preferred form is the official IANA primary name for an encoding.
 * Applications which stream text data should always specify the charset
 * in the mime type, which necessitates obtaining the encoding of the host
 * platform for data (eg files) stored in that platform's encoding.
 * A CharSet which corresponds to this and is suitable for use in a
 * mime-type for a DocFlavor can be obtained
 * from {@link DocFlavor#hostEncoding <CODE>DocFlavor.hostEncoding</CODE>}
 * This may not always be the primary IANA name but is guaranteed to be
 * understood by this VM.
 * For common flavors, the pre-defined *HOST DocFlavors may be used.
 * <p>
 * <p>
 * See <a href="../../java/lang/package-summary.html#charenc">
 * character encodings</a> for more information on the character encodings
 * supported on the Java platform.
 * <p>
 * <HR>
 * <h3>Recommended DocFlavors</h3>
 * <P>
 * The Java Print Service API does not define any mandatorily supported
 * DocFlavors.
 * However, here are some examples of MIME types that a Java Print Service
 * instance might support for client formatted print data.
 * Nested classes inside class DocFlavor declare predefined static 
 * constant DocFlavor objects for these example doc flavors; class DocFlavor's 
 * constructor can be used to create an arbitrary doc flavor. 
 * <UL>
 * <LI>Preformatted text
 * <P>
 * <TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 SUMMARY="MIME-Types and their descriptions">
 * <TR>
 *  <TH>MIME-Type</TH><TH>Description</TH>
 * </TR>
 * <TR>
 * <TD><CODE>"text/plain"</CODE></TD>
 * <TD>Plain text in the default character set (US-ASCII)</TD>
 * </TR>
 * <TR>
 * <TD><CODE>"text/plain; charset=<I>xxx</I>"</CODE></TD>
 * <TD>Plain text in character set <I>xxx</I></TD>
 * </TR>
 * <TR>
 * <TD><CODE>"text/html"</CODE></TD>
 * <TD>HyperText Markup Language in the default character set (US-ASCII)</TD>
 * </TR>
 * <TR>
 * <TD><CODE>"text/html; charset=<I>xxx</I>"</CODE></TD>
=2=

1| < PREV = PAGE 2 = NEXT > |3|4|5|6|7|8|9|10|11.15

UP TO ROOT | UP TO DIR | TO FIRST PAGE

Google
 


E-mail Facebook Google Digg del.icio.us BlinkList Fark Furl Ma.gnolia Netscape NewsVine Reddit Slashdot Spurl StumbleUpon Technorati YahooMyWeb LiveJournal Blogmarks TwitThis Live News2.ru BobrDobr.ru Memori.ru MoeMesto.ru

0.011359 wallclock secs ( 0.01 usr + 0.00 sys = 0.01 CPU)