Examples of WriteStreamOutput


Examples of com.caucho.quercus.lib.file.WriteStreamOutput

    if (javaObj == null)
      return null;
    else if (javaObj instanceof BinaryOutput)
      return (BinaryOutput) javaObj;
    else if (javaObj instanceof OutputStream)
      return new WriteStreamOutput((OutputStream) javaObj);
    else
      throw new IllegalStateException(L.l("Cannot marshal {0} to BinaryOutput",
                                          javaObj));
  }
View Full Code Here

Examples of com.caucho.quercus.lib.file.WriteStreamOutput

    Object javaObj = value.toJavaObject();

    if (javaObj instanceof BinaryOutput)
      return (BinaryOutput) javaObj;
    else if (javaObj instanceof OutputStream)
      return new WriteStreamOutput((OutputStream) javaObj);
    else
      throw new IllegalStateException(L.l("Cannot marshal {0} to BinaryOutput",
                                          javaObj));
  }
View Full Code Here

Examples of com.caucho.quercus.lib.file.WriteStreamOutput

    Object javaObj = value.toJavaObject();

    if (javaObj instanceof BinaryOutput)
      return (BinaryOutput) javaObj;
    else if (javaObj instanceof OutputStream)
      return new WriteStreamOutput((OutputStream) javaObj);
    else
      throw new IllegalStateException(L.l("Cannot marshal {0} to BinaryOutput",
                                          javaObj));
  }
View Full Code Here

Examples of com.caucho.quercus.lib.file.WriteStreamOutput

    Object javaObj = value.toJavaObject();

    if (javaObj instanceof BinaryOutput)
      return (BinaryOutput) javaObj;
    else if (javaObj instanceof OutputStream)
      return new WriteStreamOutput((OutputStream) javaObj);
    else
      throw new IllegalStateException(L.l("Cannot marshal {0} to BinaryOutput",
                                          javaObj));
  }
View Full Code Here

Examples of com.caucho.quercus.lib.file.WriteStreamOutput

    Object javaObj = value.toJavaObject();

    if (javaObj instanceof BinaryOutput)
      return (BinaryOutput) javaObj;
    else if (javaObj instanceof OutputStream)
      return new WriteStreamOutput((OutputStream) javaObj);
    else
      throw new IllegalStateException(L.l("Cannot marshal {0} to BinaryOutput",
                                          javaObj));
  }
View Full Code Here

Examples of com.caucho.quercus.lib.file.WriteStreamOutput

    Object javaObj = value.toJavaObject();

    if (javaObj instanceof BinaryOutput)
      return (BinaryOutput) javaObj;
    else if (javaObj instanceof OutputStream)
      return new WriteStreamOutput((OutputStream) javaObj);
    else
      throw new IllegalStateException(L.l("Cannot marshal {0} to BinaryOutput",
                                          javaObj));
  }
View Full Code Here

Examples of com.englishtown.vertx.jersey.WriteStreamOutput

        // Return output stream based on whether entity is chunked
        if (responseContext.isChunked()) {
            response.setChunked(true);
            return new VertxChunkedOutputStream(response);
        } else if (responseContext.hasEntity() && WriteStreamOutput.class.isAssignableFrom(responseContext.getEntityClass())) {
            WriteStreamOutput writeStreamOutput = (WriteStreamOutput) responseContext.getEntity();
            writeStreamOutput.init(response, new Handler<Void>() {
                @Override
                public void handle(Void event) {
                    end();
                }
            });
View Full Code Here

Examples of com.englishtown.vertx.jersey.WriteStreamOutput

    @Produces(MediaType.TEXT_PLAIN)
    public void getStream(
            @Context final Vertx vertx,
            @Suspended final AsyncResponse asyncResponse) {

        final WriteStreamOutput writeStreamOutput = new DefaultWriteStreamOutput();
        final Buffer buffer1 = Buffer.buffer().appendString("abcdefghijklmnopqrstuvwxyz");
        final Buffer buffer2 = Buffer.buffer().appendString("0123456789");
        int length = buffer1.length() + buffer2.length();

        asyncResponse.resume(Response
                .ok(writeStreamOutput)
                .header(HttpHeaders.CONTENT_LENGTH, length)
                .build());

        vertx.runOnContext(aVoid1 -> {
            writeStreamOutput.write(buffer1);

            vertx.runOnContext(aVoid2 -> {
                writeStreamOutput.write(buffer2);
                writeStreamOutput.end();
            });
        });
    }
View Full Code Here

Examples of com.englishtown.vertx.jersey.WriteStreamOutput

        // Return output stream based on whether entity is chunked
        if (responseContext.isChunked()) {
            response.setChunked(true);
            return new VertxChunkedOutputStream(response);
        } else if (responseContext.hasEntity() && WriteStreamOutput.class.isAssignableFrom(responseContext.getEntityClass())) {
            WriteStreamOutput writeStreamOutput = (WriteStreamOutput) responseContext.getEntity();
            writeStreamOutput.init(response, event -> {
                end();
            });
            isWriteStream = true;
            return new NOPOutputStream();
        } else {
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.