Examples of asInputStream()


Examples of com.sun.xml.ws.api.message.Attachment.asInputStream()

        Attachment root = mpp.getRootPart();
        Codec rootCodec = getMimeRootCodec(packet);
        if (rootCodec instanceof RootOnlyCodec) {
            ((RootOnlyCodec)rootCodec).decode(root.asInputStream(),root.getContentType(),packet, new MimeAttachmentSet(mpp));
        } else {
            rootCodec.decode(root.asInputStream(),root.getContentType(),packet);
            Map<String, Attachment> atts = mpp.getAttachmentParts();
            for(Map.Entry<String, Attachment> att : atts.entrySet()) {
                packet.getMessage().getAttachments().add(att.getValue());
            }
        }
View Full Code Here

Examples of org.apache.derby.iapi.types.PositionedStream.asInputStream()

        PositionedStream emptyPS = new PositionedTestStream(curBytePos);
        // Set only a few values.
        csd = new CharacterStreamDescriptor.Builder().bufferable(true).
                positionAware(true). maxCharLength(maxCharLen).
                stream(emptyPS.asInputStream()).build();
        assertEquals(true, csd.isBufferable());
        assertEquals(true, csd.isPositionAware());
        assertEquals(maxCharLen, csd.getMaxCharLength());

        // Set data offset and update the character position accordingly.
View Full Code Here

Examples of org.apache.derby.iapi.types.PositionedStream.asInputStream()

        // Set data offset and update the character position accordingly.
        csd = new CharacterStreamDescriptor.Builder().bufferable(true).
                positionAware(true).dataOffset(dataOffset).
                curCharPos(CharacterStreamDescriptor.BEFORE_FIRST).
                stream(emptyPS.asInputStream()).build();
        assertEquals(true, csd.isBufferable());
        assertEquals(true, csd.isPositionAware());
        assertEquals(dataOffset, csd.getDataOffset());
        assertEquals(CharacterStreamDescriptor.BEFORE_FIRST,
                csd.getCurCharPos());
View Full Code Here

Examples of org.apache.derby.iapi.types.PositionedStream.asInputStream()

        PositionedStream emptyPS = new PositionedTestStream(curBytePos);
        // Set only a few values.
        csd = new CharacterStreamDescriptor.Builder().bufferable(true).
                positionAware(true). maxCharLength(maxCharLen).
                stream(emptyPS.asInputStream()).build();
        assertEquals(true, csd.isBufferable());
        assertEquals(true, csd.isPositionAware());
        assertEquals(maxCharLen, csd.getMaxCharLength());

        // Set data offset and update the character position accordingly.
View Full Code Here

Examples of org.apache.derby.iapi.types.PositionedStream.asInputStream()

        // Set data offset and update the character position accordingly.
        csd = new CharacterStreamDescriptor.Builder().bufferable(true).
                positionAware(true).dataOffset(dataOffset).
                curCharPos(CharacterStreamDescriptor.BEFORE_FIRST).
                stream(emptyPS.asInputStream()).build();
        assertEquals(true, csd.isBufferable());
        assertEquals(true, csd.isPositionAware());
        assertEquals(dataOffset, csd.getDataOffset());
        assertEquals(CharacterStreamDescriptor.BEFORE_FIRST,
                csd.getCurCharPos());
View Full Code Here

Examples of org.apache.isis.viewer.json.applib.JsonRepresentation.asInputStream()

        final DomainObjectResource domainObjectResource = client.getDomainObjectResource();

        final JsonRepresentation body = JsonRepresentation.newArray();

        // when
        final Response actionInvokeResp = domainObjectResource.invokeAction("OID:1", "list", body.asInputStream());
        final RestfulResponse<ScalarValueRepresentation> actionInvokeJsonResp = RestfulResponse.ofT(actionInvokeResp);
        assertThat(actionInvokeJsonResp.getStatus().getFamily(), is(Family.SUCCESSFUL));

        // then
        final ScalarValueRepresentation actionInvokeRepr = actionInvokeJsonResp.getEntity();
View Full Code Here

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

        ServletUtils.copy(req.getInputStream(), reqBuffer
            .asOutputStream());
        reqBuffer.flip();
        get
            .setRequestEntity(new InputStreamRequestEntity(
                reqBuffer.asInputStream(), reqContentLength,
                "application/x-amf"));
        // get.setPath(path);
        get.addRequestHeader("Tunnel-request", path);

        client.executeMethod(get);
View Full Code Here

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

              .intValue();
          ByteBuffer respBuffer = ByteBuffer.allocate(responseLength);
          ServletUtils.copy(get.getResponseBodyAsStream(), respBuffer
              .asOutputStream());
          respBuffer.flip();
          ServletUtils.copy(respBuffer.asInputStream(), resp
              .getOutputStream());
          resp.flushBuffer();
        } else {
          resp.sendError(get.getStatusCode());
        }
View Full Code Here

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

        object.serialize(out);
        buf.flip();

        FileOutputStream output = new FileOutputStream(resFile
            .getFile().getAbsolutePath());
        ServletUtils.copy(buf.asInputStream(), output);
        output.close();
      } finally {
        buf.release();
        buf = null;
      }
View Full Code Here

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

    log.debug("Sending response");
    ByteBuffer respBuffer = codecFactory.getSimpleEncoder().encode(null,
        packet);
    final ServletOutputStream out = resp.getOutputStream();
    resp.setContentLength(respBuffer.limit());
    ServletUtils.copy(respBuffer.asInputStream(), out);
    out.flush();
    out.close();
    respBuffer.release();
    respBuffer = null;
  }
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.