title: InputStream to servletInputStream
body: <p>I have this InputStream:</p>
  
  <pre><code>InputStream inputStream = new ByteArrayInputStream(myString.getBytes(StandardCharsets.UTF_8));
  </code></pre>
  
  <p>How can I convert this to ServletInputStream?</p>
  
  <p>I have tried:</p>
  
  <pre><code>ServletInputStream  servletInputStream = (ServletInputStream) inputStream;
  </code></pre>
  
  <p>but do not work.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>My method is this:</p>
  
  <pre><code>private static class LowerCaseRequest extends HttpServletRequestWrapper {
  
          public LowerCaseRequest(final HttpServletRequest request) throws IOException, ServletException {
              super(request);
          }
  
          @Override
          public ServletInputStream getInputStream() throws IOException {
  
              ServletInputStream servletInputStream;
  
              StringBuilder jb = new StringBuilder();
              String line;
              String toLowerCase = "";
  
              BufferedReader reader = new BufferedReader(new InputStreamReader(super.getInputStream()));
              while ((line = reader.readLine()) != null) {
                  toLowerCase = jb.append(line).toString().toLowerCase();
              }
  
              InputStream inputStream = new ByteArrayInputStream(toLowerCase.getBytes(StandardCharsets.UTF_8));
  
              servletInputStream = (ServletInputStream) inputStream;
  
              return servletInputStream;
  
          }
   }
  </code></pre>
  
  <p>I´m trying to convert all my request to lowercase. </p>