PageRenderTime 211ms CodeModel.GetById 144ms app.highlight 27ms RepoModel.GetById 5ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/api/org/gjt/sp/jedit/io/AutoDetection.html

#
HTML | 332 lines | 277 code | 42 blank | 13 comment | 0 complexity | 6d5bd379418712860ffbd4cec75d8437 MD5 | raw file
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2<!--NewPage-->
  3<HTML>
  4<HEAD>
  5<!-- Generated by javadoc (build 1.5.0_14) on Tue Jul 22 07:14:02 GMT-08:00 2008 -->
  6<TITLE>
  7AutoDetection (jEdit API)
  8</TITLE>
  9
 10<META NAME="keywords" CONTENT="org.gjt.sp.jedit.io.AutoDetection class">
 11
 12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
 13
 14
 15<NOSCRIPT>
 16</NOSCRIPT>
 17
 18</HEAD>
 19
 20<BODY BGCOLOR="white" >
 21
 22
 23<!-- ========= START OF TOP NAVBAR ======= -->
 24<A NAME="navbar_top"><!-- --></A>
 25<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
 26<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
 27<TR>
 28<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
 29<A NAME="navbar_top_firstrow"><!-- --></A>
 30<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
 31  <TR ALIGN="center" VALIGN="top">
 32  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
 33  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
 34  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
 35  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/AutoDetection.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
 36  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
 37  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
 38  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
 39  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
 40  </TR>
 41</TABLE>
 42</TD>
 43<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
 44</EM>
 45</TD>
 46</TR>
 47
 48<TR>
 49<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 50&nbsp;PREV CLASS&nbsp;
 51&nbsp;<A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.Result.html" title="class in org.gjt.sp.jedit.io"><B>NEXT CLASS</B></A></FONT></TD>
 52<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 53  <A HREF="../../../../../index.html?org/gjt/sp/jedit/io/AutoDetection.html" target="_top"><B>FRAMES</B></A>  &nbsp;
 54&nbsp;<A HREF="AutoDetection.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
 55&nbsp;
 56<NOSCRIPT>
 57  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
 58</NOSCRIPT>
 59
 60
 61</FONT></TD>
 62</TR>
 63<TR>
 64<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 65  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
 66<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 67DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
 68</TR>
 69</TABLE>
 70<A NAME="skip-navbar_top"></A>
 71<!-- ========= END OF TOP NAVBAR ========= -->
 72
 73<HR>
 74<!-- ======== START OF CLASS DATA ======== -->
 75<H2>
 76<FONT SIZE="-1">
 77org.gjt.sp.jedit.io</FONT>
 78<BR>
 79Class AutoDetection</H2>
 80<PRE>
 81java.lang.Object
 82  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.jedit.io.AutoDetection</B>
 83</PRE>
 84<HR>
 85<DL>
 86<DT><PRE>public class <B>AutoDetection</B><DT>extends java.lang.Object</DL>
 87</PRE>
 88
 89<P>
 90Some functions for auto detection of I/O stream properties.
 91<P>
 92
 93<P>
 94<HR>
 95
 96<P>
 97<!-- ======== NESTED CLASS SUMMARY ======== -->
 98
 99<A NAME="nested_class_summary"><!-- --></A>
100<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
101<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
102<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
103<B>Nested Class Summary</B></FONT></TH>
104</TR>
105<TR BGCOLOR="white" CLASS="TableRowColor">
106<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
107<CODE>static&nbsp;class</CODE></FONT></TD>
108<TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.Result.html" title="class in org.gjt.sp.jedit.io">AutoDetection.Result</A></B></CODE>
109
110<BR>
111&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;An utility class to hold the result of some auto detections.</TD>
112</TR>
113</TABLE>
114&nbsp;
115<!-- ======== CONSTRUCTOR SUMMARY ======== -->
116
117<A NAME="constructor_summary"><!-- --></A>
118<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
119<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
120<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
121<B>Constructor Summary</B></FONT></TH>
122</TR>
123<TR BGCOLOR="white" CLASS="TableRowColor">
124<TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.html#AutoDetection()">AutoDetection</A></B>()</CODE>
125
126<BR>
127&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
128</TR>
129</TABLE>
130&nbsp;
131<!-- ========== METHOD SUMMARY =========== -->
132
133<A NAME="method_summary"><!-- --></A>
134<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
135<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
136<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
137<B>Method Summary</B></FONT></TH>
138</TR>
139<TR BGCOLOR="white" CLASS="TableRowColor">
140<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
141<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
142<TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.html#getDetectedEncoding(java.io.BufferedInputStream)">getDetectedEncoding</A></B>(java.io.BufferedInputStream&nbsp;markedStream)</CODE>
143
144<BR>
145&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an auto detected encoding from content of markedStream.</TD>
146</TR>
147<TR BGCOLOR="white" CLASS="TableRowColor">
148<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
149<CODE>static&nbsp;java.util.List&lt;<A HREF="../../../../../org/gjt/sp/jedit/io/EncodingDetector.html" title="interface in org.gjt.sp.jedit.io">EncodingDetector</A>&gt;</CODE></FONT></TD>
150<TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.html#getEncodingDetectors()">getEncodingDetectors</A></B>()</CODE>
151
152<BR>
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the user configured ordered list of encoding detectors.</TD>
154</TR>
155<TR BGCOLOR="white" CLASS="TableRowColor">
156<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
157<CODE>static&nbsp;java.io.BufferedInputStream</CODE></FONT></TD>
158<TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.html#getMarkedStream(java.io.InputStream)">getMarkedStream</A></B>(java.io.InputStream&nbsp;in)</CODE>
159
160<BR>
161&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a marked, rewindable stream.</TD>
162</TR>
163<TR BGCOLOR="white" CLASS="TableRowColor">
164<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
165<CODE>static&nbsp;boolean</CODE></FONT></TD>
166<TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.html#isGzipped(java.io.InputStream)">isGzipped</A></B>(java.io.InputStream&nbsp;sample)</CODE>
167
168<BR>
169&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns wheather the stream is gzipped.</TD>
170</TR>
171</TABLE>
172&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
173<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
174<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
175<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
176</TR>
177<TR BGCOLOR="white" CLASS="TableRowColor">
178<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
179</TR>
180</TABLE>
181&nbsp;
182<P>
183
184<!-- ========= CONSTRUCTOR DETAIL ======== -->
185
186<A NAME="constructor_detail"><!-- --></A>
187<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
188<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
189<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
190<B>Constructor Detail</B></FONT></TH>
191</TR>
192</TABLE>
193
194<A NAME="AutoDetection()"><!-- --></A><H3>
195AutoDetection</H3>
196<PRE>
197public <B>AutoDetection</B>()</PRE>
198<DL>
199</DL>
200
201<!-- ============ METHOD DETAIL ========== -->
202
203<A NAME="method_detail"><!-- --></A>
204<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
205<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
206<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
207<B>Method Detail</B></FONT></TH>
208</TR>
209</TABLE>
210
211<A NAME="getMarkedStream(java.io.InputStream)"><!-- --></A><H3>
212getMarkedStream</H3>
213<PRE>
214public static java.io.BufferedInputStream <B>getMarkedStream</B>(java.io.InputStream&nbsp;in)</PRE>
215<DL>
216<DD>Returns a marked, rewindable stream.
217 Calling reset() method rewinds the stream to its beginning.
218 But reset() can fail if too long bytes were read.
219<P>
220<DD><DL>
221</DL>
222</DD>
223</DL>
224<HR>
225
226<A NAME="isGzipped(java.io.InputStream)"><!-- --></A><H3>
227isGzipped</H3>
228<PRE>
229public static boolean <B>isGzipped</B>(java.io.InputStream&nbsp;sample)
230                         throws java.io.IOException</PRE>
231<DL>
232<DD>Returns wheather the stream is gzipped.
233 This method reads a few bytes from the sample. So a caller
234 must take care of mark() to reuse the contents. Wraping the
235 stream by getMarkedStream() is suitable.
236<P>
237<DD><DL>
238
239<DT><B>Throws:</B>
240<DD><CODE>java.io.IOException</CODE></DL>
241</DD>
242</DL>
243<HR>
244
245<A NAME="getEncodingDetectors()"><!-- --></A><H3>
246getEncodingDetectors</H3>
247<PRE>
248public static java.util.List&lt;<A HREF="../../../../../org/gjt/sp/jedit/io/EncodingDetector.html" title="interface in org.gjt.sp.jedit.io">EncodingDetector</A>&gt; <B>getEncodingDetectors</B>()</PRE>
249<DL>
250<DD>Returns the user configured ordered list of encoding detectors.
251 This method reads property "encodingDetectors".
252<P>
253<DD><DL>
254</DL>
255</DD>
256</DL>
257<HR>
258
259<A NAME="getDetectedEncoding(java.io.BufferedInputStream)"><!-- --></A><H3>
260getDetectedEncoding</H3>
261<PRE>
262public static java.lang.String <B>getDetectedEncoding</B>(java.io.BufferedInputStream&nbsp;markedStream)
263                                            throws java.io.IOException</PRE>
264<DL>
265<DD>Returns an auto detected encoding from content of markedStream.
266 This method assumes that markedStream is wrapped by
267 getMarkedStream() method.
268<P>
269<DD><DL>
270
271<DT><B>Throws:</B>
272<DD><CODE>java.io.IOException</CODE></DL>
273</DD>
274</DL>
275<!-- ========= END OF CLASS DATA ========= -->
276<HR>
277
278
279<!-- ======= START OF BOTTOM NAVBAR ====== -->
280<A NAME="navbar_bottom"><!-- --></A>
281<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
282<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
283<TR>
284<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
285<A NAME="navbar_bottom_firstrow"><!-- --></A>
286<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
287  <TR ALIGN="center" VALIGN="top">
288  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
289  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
290  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
291  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/AutoDetection.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
292  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
293  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
294  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
295  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
296  </TR>
297</TABLE>
298</TD>
299<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
300</EM>
301</TD>
302</TR>
303
304<TR>
305<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
306&nbsp;PREV CLASS&nbsp;
307&nbsp;<A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.Result.html" title="class in org.gjt.sp.jedit.io"><B>NEXT CLASS</B></A></FONT></TD>
308<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
309  <A HREF="../../../../../index.html?org/gjt/sp/jedit/io/AutoDetection.html" target="_top"><B>FRAMES</B></A>  &nbsp;
310&nbsp;<A HREF="AutoDetection.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
311&nbsp;
312<NOSCRIPT>
313  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
314</NOSCRIPT>
315
316
317</FONT></TD>
318</TR>
319<TR>
320<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
321  SUMMARY:&nbsp;<A HREF="#nested_class_summary">NESTED</A>&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
322<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
323DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
324</TR>
325</TABLE>
326<A NAME="skip-navbar_bottom"></A>
327<!-- ======== END OF BOTTOM NAVBAR ======= -->
328
329<HR>
330
331</BODY>
332</HTML>