Package javax.servlet

Examples of javax.servlet.ServletInputStream


            }
           
            @Override
            public ServletInputStream getInputStream() throws IOException
            {
                return new ServletInputStream() {

                    @Override
                    public int read() throws IOException
                    {
                        return is.read();
View Full Code Here


    super.readData(request, params, charset);

    // 以http body方式提交的参数
    try {
      ServletInputStream inputStream = request.getInputStream();
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      byte[] b = new byte[4096];
      for (int n; (n = inputStream.read(b)) != -1;) {
        baos.write(b);
      }
      this.processByteArray(params, baos.toByteArray(), charset);
      baos.close();
    } catch (Exception e) {
View Full Code Here

    String boundary = extractBoundary(type);
    if (boundary == null) {
      throw new IOException("Separation boundary was not specified");
    }

    ServletInputStream in = req.getInputStream();
   
    // If required, wrap the real input stream with classes that
    // "enhance" its behaviour for performance and stability
    if (buffer) {
      in = new BufferedServletInputStream(in);
View Full Code Here

            throws ServletException, IOException {

        response.setContentType(RESPONSE_CONTENT_TYPE);
        try {
            /* get the RemoteInvocation object */
            ServletInputStream sis = request.getInputStream();
            ObjectInputStream ois = new ObjectInputStream(sis);
            RemoteInvocation invocation = (RemoteInvocation) ois.readObject();
            ois.close();
            /* execute the method */
            InvocationResult result = ServiceCallHandler.execute(invocation);
View Full Code Here

         // See if the request already has the MarshalledInvocation
         MarshalledInvocation mi = (MarshalledInvocation) request.getAttribute("MarshalledInvocation");
         if( mi == null )
         {
            // Get the invocation from the post
            ServletInputStream sis = request.getInputStream();
            ObjectInputStream ois = new ObjectInputStream(sis);
            mi = (MarshalledInvocation) ois.readObject();
            ois.close();
         }
         /* If the invocation carries no auth context, look to to the auth
View Full Code Here

      Principal user = httpRequest.getUserPrincipal();
      // If there was a read-only context specified validate access
      if( user == null && readOnlyContext != null )
      {
         // Extract the invocation
         ServletInputStream sis = request.getInputStream();
         ObjectInputStream ois = new ObjectInputStream(sis);
         MarshalledInvocation mi = null;
         try
         {
            mi = (MarshalledInvocation) ois.readObject();
View Full Code Here

    public static MockHttpSession session(MockServletContext context) {
      return new MockHttpSession(context);
    }

    public static ServletInputStream ins(final InputStream ins) {
      return new ServletInputStream() {
        public int read() throws IOException {
          return ins.read();
        }

        public int available() throws IOException {
View Full Code Here

     * 准备缓冲环,并跳过开始标记
     */
    MarkMode mm;
    BufferRing br;
    try {
      ServletInputStream ins = req.getInputStream();
      // 构建 3 个环节点的缓冲环
      br = new BufferRing(ins, 3, bufferSize);
      // 初始加载
      info.current = br.load();
      // 跳过开始的标记
View Full Code Here

      TempBuffer tempBuf = TempBuffer.allocate();
      byte []buf = tempBuf.getBuffer();
     
      try {
        ServletInputStream sis = req.getInputStream();
        int len;

        while ((len = sis.read(buf, 0, buf.length)) > 0) {
          outputStream.write(buf, 0, len);
        }

        outputStream.flush();
      } catch (IOException e) {
View Full Code Here

    }

    @SuppressWarnings("unused")
    @DataProvider(name = "validXMLServletStreamProvider")
    private Object[][] servletStreamProvider() {
        ServletInputStream validProcessXML = getServletInputStream(SAMPLE_PROCESS_XML);
        return new Object[][]{{EntityType.PROCESS, validProcessXML},
        };

    }
View Full Code Here

TOP

Related Classes of javax.servlet.ServletInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.