PageRenderTime 40ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
HTML | 258 lines | 211 code | 35 blank | 12 comment | 0 complexity | 7acf7dab1fde029ba0c665328f9a47e7 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. BufferLocalEncodingDetector (jEdit API)
  8. </TITLE>
  9. <META NAME="keywords" CONTENT="org.gjt.sp.jedit.io.BufferLocalEncodingDetector 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/BufferLocalEncodingDetector.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;<A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.Result.html" title="class in org.gjt.sp.jedit.io"><B>PREV CLASS</B></A>&nbsp;
  42. &nbsp;<A HREF="../../../../../org/gjt/sp/jedit/io/CharsetEncoding.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/BufferLocalEncodingDetector.html" target="_top"><B>FRAMES</B></A> &nbsp;
  45. &nbsp;<A HREF="BufferLocalEncodingDetector.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;NESTED&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 BufferLocalEncodingDetector</H2>
  68. <PRE>
  69. java.lang.Object
  70. <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.jedit.io.BufferLocalEncodingDetector</B>
  71. </PRE>
  72. <DL>
  73. <DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../../../org/gjt/sp/jedit/io/EncodingDetector.html" title="interface in org.gjt.sp.jedit.io">EncodingDetector</A></DD>
  74. </DL>
  75. <HR>
  76. <DL>
  77. <DT><PRE>public class <B>BufferLocalEncodingDetector</B><DT>extends java.lang.Object<DT>implements <A HREF="../../../../../org/gjt/sp/jedit/io/EncodingDetector.html" title="interface in org.gjt.sp.jedit.io">EncodingDetector</A></DL>
  78. </PRE>
  79. <P>
  80. An encoding detector which finds buffer-local-property syntax.
  81. This reads the sample in the system default encoding for first 10
  82. lines and look for ":encoding=..." syntax. This can fail if the
  83. stream cannot be read in the system default encoding or
  84. ":encoding=..." is not placed at near the top of the stream.
  85. <P>
  86. <P>
  87. <DL>
  88. <DT><B>Since:</B></DT>
  89. <DD>4.3pre10</DD>
  90. </DL>
  91. <HR>
  92. <P>
  93. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  94. <A NAME="constructor_summary"><!-- --></A>
  95. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  96. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  97. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  98. <B>Constructor Summary</B></FONT></TH>
  99. </TR>
  100. <TR BGCOLOR="white" CLASS="TableRowColor">
  101. <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/io/BufferLocalEncodingDetector.html#BufferLocalEncodingDetector()">BufferLocalEncodingDetector</A></B>()</CODE>
  102. <BR>
  103. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  104. </TR>
  105. </TABLE>
  106. &nbsp;
  107. <!-- ========== METHOD SUMMARY =========== -->
  108. <A NAME="method_summary"><!-- --></A>
  109. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  110. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  111. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  112. <B>Method Summary</B></FONT></TH>
  113. </TR>
  114. <TR BGCOLOR="white" CLASS="TableRowColor">
  115. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  116. <CODE>&nbsp;java.lang.String</CODE></FONT></TD>
  117. <TD><CODE><B><A HREF="../../../../../org/gjt/sp/jedit/io/BufferLocalEncodingDetector.html#detectEncoding(java.io.InputStream)">detectEncoding</A></B>(java.io.InputStream&nbsp;sample)</CODE>
  118. <BR>
  119. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the name of a detected encoding for the bytes in sample.</TD>
  120. </TR>
  121. </TABLE>
  122. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  123. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  124. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  125. <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
  126. </TR>
  127. <TR BGCOLOR="white" CLASS="TableRowColor">
  128. <TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
  129. </TR>
  130. </TABLE>
  131. &nbsp;
  132. <P>
  133. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  134. <A NAME="constructor_detail"><!-- --></A>
  135. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  136. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  137. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  138. <B>Constructor Detail</B></FONT></TH>
  139. </TR>
  140. </TABLE>
  141. <A NAME="BufferLocalEncodingDetector()"><!-- --></A><H3>
  142. BufferLocalEncodingDetector</H3>
  143. <PRE>
  144. public <B>BufferLocalEncodingDetector</B>()</PRE>
  145. <DL>
  146. </DL>
  147. <!-- ============ METHOD DETAIL ========== -->
  148. <A NAME="method_detail"><!-- --></A>
  149. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  150. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  151. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  152. <B>Method Detail</B></FONT></TH>
  153. </TR>
  154. </TABLE>
  155. <A NAME="detectEncoding(java.io.InputStream)"><!-- --></A><H3>
  156. detectEncoding</H3>
  157. <PRE>
  158. public java.lang.String <B>detectEncoding</B>(java.io.InputStream&nbsp;sample)
  159. throws java.io.IOException</PRE>
  160. <DL>
  161. <DD><B>Description copied from interface: <CODE><A HREF="../../../../../org/gjt/sp/jedit/io/EncodingDetector.html#detectEncoding(java.io.InputStream)">EncodingDetector</A></CODE></B></DD>
  162. <DD>Returns the name of a detected encoding for the bytes in sample.
  163. Returns null if this instance could not detect reasonable one.
  164. <P>
  165. <DD><DL>
  166. <DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/gjt/sp/jedit/io/EncodingDetector.html#detectEncoding(java.io.InputStream)">detectEncoding</A></CODE> in interface <CODE><A HREF="../../../../../org/gjt/sp/jedit/io/EncodingDetector.html" title="interface in org.gjt.sp.jedit.io">EncodingDetector</A></CODE></DL>
  167. </DD>
  168. <DD><DL>
  169. <DT><B>Throws:</B>
  170. <DD><CODE>java.io.IOException</CODE></DL>
  171. </DD>
  172. </DL>
  173. <!-- ========= END OF CLASS DATA ========= -->
  174. <HR>
  175. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  176. <A NAME="navbar_bottom"><!-- --></A>
  177. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  178. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  179. <TR>
  180. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  181. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  182. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  183. <TR ALIGN="center" VALIGN="top">
  184. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  185. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  186. <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  187. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/BufferLocalEncodingDetector.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  188. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  189. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  190. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  191. <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  192. </TR>
  193. </TABLE>
  194. </TD>
  195. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  196. </EM>
  197. </TD>
  198. </TR>
  199. <TR>
  200. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  201. &nbsp;<A HREF="../../../../../org/gjt/sp/jedit/io/AutoDetection.Result.html" title="class in org.gjt.sp.jedit.io"><B>PREV CLASS</B></A>&nbsp;
  202. &nbsp;<A HREF="../../../../../org/gjt/sp/jedit/io/CharsetEncoding.html" title="class in org.gjt.sp.jedit.io"><B>NEXT CLASS</B></A></FONT></TD>
  203. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  204. <A HREF="../../../../../index.html?org/gjt/sp/jedit/io/BufferLocalEncodingDetector.html" target="_top"><B>FRAMES</B></A> &nbsp;
  205. &nbsp;<A HREF="BufferLocalEncodingDetector.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
  206. &nbsp;
  207. <NOSCRIPT>
  208. <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
  209. </NOSCRIPT>
  210. </FONT></TD>
  211. </TR>
  212. <TR>
  213. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  214. SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  215. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  216. DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  217. </TR>
  218. </TABLE>
  219. <A NAME="skip-navbar_bottom"></A>
  220. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  221. <HR>
  222. </BODY>
  223. </HTML>