test_class.declarator: htmlDetector
test_class.modifier: @Autowired
      private
test_class.original_string: @Autowired
      private HtmlDetector htmlDetector;
test_class.type: HtmlDetector
test_class.var_name: htmlDetector
test_class.file: dataprep-backend-service/src/test/java/org/talend/dataprep/schema/html/HtmlDetectorTest.java
test_class.identifier: HtmlDetectorTest
test_class.superclass: extends AbstractSchemaTestUtils
test_case.body: @Test
      public void guess_html_format_fail() throws Exception {
  
          String fileName = "foo.html";
  
          Format actual = htmlDetector.detect(this.getClass().getResourceAsStream(fileName));
          assertNull(actual);
      }
test_case.class_method_signature: HtmlDetectorTest.guess_html_format_fail()
test_case.full_signature: @Test public void guess_html_format_fail()
test_case.identifier: guess_html_format_fail
test_case.invocations: detect getResourceAsStream getClass assertNull
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void guess_html_format_fail()
focal_class.declarator: htmlEncodingDetector = new HtmlEncodingDetector()
focal_class.modifier: private
focal_class.original_string: private HtmlEncodingDetector htmlEncodingDetector = new HtmlEncodingDetector();
focal_class.type: HtmlEncodingDetector
focal_class.var_name: htmlEncodingDetector
focal_class.declarator: htmlFormatFamily
focal_class.modifier: @Autowired
      private
focal_class.original_string: @Autowired
      private HtmlFormatFamily htmlFormatFamily;
focal_class.type: HtmlFormatFamily
focal_class.var_name: htmlFormatFamily
focal_class.file: dataprep-backend-service/src/main/java/org/talend/dataprep/schema/html/HtmlDetector.java
focal_class.identifier: HtmlDetector
focal_class.interfaces: implements Detector
focal_class.class_method_signature: HtmlDetector.detect(Metadata metadata, TikaInputStream inputStream)
focal_class.full_signature: @Override public Format detect(Metadata metadata, TikaInputStream inputStream)
focal_class.identifier: detect
focal_class.modifiers: @Override public
focal_class.parameters: (Metadata metadata, TikaInputStream inputStream)
focal_class.return: Format
focal_class.signature: Format detect(Metadata metadata, TikaInputStream inputStream)
focal_method.body: @Override
      public Format detect(Metadata metadata, TikaInputStream inputStream) throws IOException {
          if (inputStream == null) {
              return null;
          } else {
              inputStream.mark(FormatUtils.META_TAG_BUFFER_SIZE);
              byte[] buffer = new byte[FormatUtils.META_TAG_BUFFER_SIZE];
              int n = 0;
  
              for (int m = inputStream.read(buffer); m != -1 && n < buffer.length; m =
                      inputStream.read(buffer, n, buffer.length - n)) {
                  n += m;
              }
  
              inputStream.reset();
              String head = FormatUtils.readFromBuffer(buffer, 0, n);
              try (InputStream stream = TikaInputStream.get(IOUtils.toInputStream(head))) {
                  Charset charset = htmlEncodingDetector.detect(stream, metadata);
  
                  if (charset != null) {
                      return new Format(htmlFormatFamily, charset.name());
                  }
              }
              return null;
          }
  
      }
focal_method.class_method_signature: HtmlDetector.detect(Metadata metadata, TikaInputStream inputStream)
focal_method.full_signature: @Override public Format detect(Metadata metadata, TikaInputStream inputStream)
focal_method.identifier: detect
focal_method.invocations: mark read read reset readFromBuffer get toInputStream detect name
focal_method.modifiers: @Override public
focal_method.parameters: (Metadata metadata, TikaInputStream inputStream)
focal_method.return: Format
focal_method.signature: Format detect(Metadata metadata, TikaInputStream inputStream)