Examples of asOutputStream()


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

   *             General exception
   */
  protected RemotingPacket decodeRequest(HttpServletRequest req) throws Exception {
    log.debug("Decoding request");
    IoBuffer reqBuffer = IoBuffer.allocate(req.getContentLength());
    ServletUtils.copy(req, reqBuffer.asOutputStream());
    reqBuffer.flip();
    RemotingPacket packet = (RemotingPacket) codecFactory.getRemotingDecoder().decode(reqBuffer);
    String path = req.getContextPath();
    if (path == null) {
      path = "";
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

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

            + "lns=\"\">action</negotiatedParams></openChannelResponse></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

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

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

                        && version[1] == SoapTcpProtocolConsts.PROTOCOL_VERSION_MINOR
                        && version[2] == SoapTcpProtocolConsts.CONNECTION_MANAGEMENT_VERSION_MAJOR
                        && version[3] == SoapTcpProtocolConsts.CONNECTION_MANAGEMENT_VERSION_MINOR) {
                        sessionState.setStateId(SoapTcpSessionState.SOAP_TCP_SESSION_STATE_AFTER_HANDSHAKE);
                        IoBuffer response = IoBuffer.allocate(2);
                        OutputStream out = response.asOutputStream();
                        DataCodingUtils.writeInts4(out, SoapTcpProtocolConsts.PROTOCOL_VERSION_MAJOR,
                                                   SoapTcpProtocolConsts.PROTOCOL_VERSION_MINOR,
                                                   SoapTcpProtocolConsts.CONNECTION_MANAGEMENT_VERSION_MAJOR,
                                                   SoapTcpProtocolConsts.CONNECTION_MANAGEMENT_VERSION_MINOR);
                        out.close();
View Full Code Here

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

        if (obj instanceof SoapTcpMessage) {
           
            SoapTcpMessage msg = (SoapTcpMessage)obj;
            IoBuffer buffer = IoBuffer.allocate(1024);
            buffer.setAutoExpand(true);
            OutputStream outStream = buffer.asOutputStream();
            SoapTcpUtils.writeSoapTcpMessage(outStream, msg);
            outStream.close();
            out.write(buffer);
        }
View Full Code Here

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

        SoapTcpChannel channel = exchange.getInMessage().getContent(SoapTcpChannel.class);
        String message = new String(baos.toByteArray());
        SoapTcpMessage soapTcpMessage = SoapTcpMessage.createSoapTcpMessage(message, channel.getChannelId());
        IoBuffer buffer = IoBuffer.allocate(512);
        buffer.setAutoExpand(true);
        SoapTcpUtils.writeSoapTcpMessage(buffer.asOutputStream(), soapTcpMessage);
        buffer.flip();
        session.write(buffer);
    }
}
View Full Code Here

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

  }

  @Override
  public void encode(IoSession session, Object message, ProtocolEncoderOutput encoderOut) throws Exception {
    IoBuffer buffer = IoBuffer.allocate(1024);
    OutputStream out = buffer.asOutputStream();
    try {
      encoder.encode((ClientRequest) message, out);
    } finally {
      out.close();
    }
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.