code: @Override public int read() throws IOException
     {
        int c;
  
        if (m_searching)
        {
           int index = 0;
           c = -1;
           while (m_searching)
           {
              c = m_stream.read();
              if (c == -1)
              {
                 m_searchFailed = true;
                 throw new IOException("Pattern not found");
              }
  
              if (c == m_pattern[index])
              {
                 ++index;
                 if (index == m_pattern.length)
                 {
                    m_searching = false;
                    c = m_stream.read();
                 }
              }
              else
              {
                 index = 0;
              }
           }
        }
        else
        {
           c = m_stream.read();
        }
  
        return c;
     }
docs: {@inheritDoc}