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