Examples of asOutputStream()


Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

      if (reqContentLength > 0) {
        // System.out.println("Request content length: " +
        // reqContentLength);

        ByteBuffer reqBuffer = ByteBuffer.allocate(reqContentLength);
        ServletUtils.copy(req.getInputStream(), reqBuffer
            .asOutputStream());
        reqBuffer.flip();
        get
            .setRequestEntity(new InputStreamRequestEntity(
                reqBuffer.asInputStream(), reqContentLength,
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

        if (get.getStatusCode() == HttpStatus.SC_OK) {
          resp.setContentType("application/x-amf");
          int responseLength = ((Long) get.getResponseContentLength())
              .intValue();
          ByteBuffer respBuffer = ByteBuffer.allocate(responseLength);
          ServletUtils.copy(get.getResponseBodyAsStream(), respBuffer
              .asOutputStream());
          respBuffer.flip();
          ServletUtils.copy(respBuffer.asInputStream(), resp
              .getOutputStream());
          resp.flushBuffer();
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

    }

    try {
      ByteBuffer buf = ByteBuffer.allocate(input.available());
      try {
        ServletUtils.copy(input, buf.asOutputStream());
        buf.flip();
        Input in = new Input(buf);
        Deserializer deserializer = new Deserializer();
        String className = deserializer.deserialize(in, String.class);
        if (result == null) {
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

   */
  protected RemotingPacket decodeRequest(HttpServletRequest req)
      throws Exception {
    log.debug("Decoding request");
    ByteBuffer reqBuffer = ByteBuffer.allocate(req.getContentLength());
    ServletUtils.copy(req.getInputStream(), reqBuffer.asOutputStream());
    reqBuffer.flip();
    RemotingPacket packet = (RemotingPacket) codecFactory
        .getSimpleDecoder().decode(null, reqBuffer);
    String path = req.getContextPath();
    if (path == null) {
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

    try {

      //req.getSession().getAttribute(REMOTING_CONNECTOR);

      reqBuffer = ByteBuffer.allocate(req.getContentLength());
      ServletUtils.copy(req.getInputStream(), reqBuffer.asOutputStream());
      //reqBuffer.flip();

      log.info(HexDump.formatHexDump(reqBuffer.getHexDump()));

    } catch (IOException e) {
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

    try {

      // req.getSession().getAttribute(REMOTING_CONNECTOR);

      reqBuffer = ByteBuffer.allocate(req.getContentLength());
      ServletUtils.copy(req.getInputStream(), reqBuffer.asOutputStream());
      reqBuffer.flip();

      // Connect to the server.
      VmPipeConnector connector = new VmPipeConnector();
      IoHandler handler = new Handler(req, resp);
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

   * @throws IOException
   *             I/O exception
   */
  protected void skipData(HttpServletRequest req) throws IOException {
    ByteBuffer data = ByteBuffer.allocate(req.getContentLength());
    ServletUtils.copy(req.getInputStream(), data.asOutputStream());
    data.flip();
    data.release();
    data = null;
  }

View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

    client.setServletRequest(req);

    // Put the received data in a ByteBuffer
    int length = req.getContentLength();
    ByteBuffer data = ByteBuffer.allocate(length);
    ServletUtils.copy(req.getInputStream(), data.asOutputStream());
    data.flip();

    // Decode the objects in the data
    List messages = client.decode(data);
    data.release();
View Full Code Here

Examples of org.apache.mina.common.ByteBuffer.asOutputStream()

   * Compress contents using zlib.
   */
  public void compress() {
    ByteBuffer tmp = ByteBuffer.allocate(0);
    tmp.setAutoExpand(true);
    DeflaterOutputStream deflater = new DeflaterOutputStream(tmp.asOutputStream(), new Deflater(Deflater.BEST_COMPRESSION));
    byte[] tmpData = new byte[data.limit()];
    data.position(0);
    data.get(tmpData);
    try {
      deflater.write(tmpData);
View Full Code Here

Examples of org.apache.mina.core.buffer.IoBuffer.asOutputStream()

            + "XMLSchema\"/></s:Body></s:Envelope>";
        SoapTcpMessage soapTcpMessage = SoapTcpMessage.createSoapTcpMessage(response, 0);
        IoBuffer buffer = IoBuffer.allocate(512);
        buffer.setAutoExpand(true);
        try {
            SoapTcpUtils.writeSoapTcpMessage(buffer.asOutputStream(), soapTcpMessage);
        } catch (IOException e) {
            e.printStackTrace();
        }
        buffer.flip();
        session.write(buffer);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.