Examples of createInputStream()


Examples of be.bagofwords.virtualfile.VirtualFile.createInputStream()

                Action action = Action.values()[actionAsByte];
                if (action == Action.INPUT_STREAM) {
                    String relPath = connection.readString();
                    VirtualFile file = virtualFileService.getRootDirectory().getFile(relPath);
                    if (file.exists()) {
                        InputStream is = file.createInputStream();
                        connection.writeLong(LONG_OK);
                        IOUtils.copy(is, connection.getOs());
                        connection.flush();
                    } else {
                        connection.writeLong(LONG_ERROR);
View Full Code Here

Examples of com.github.stephenc.javaisotools.sabre.DataReference.createInputStream()

        Tag descriptorTag = new Tag();
        byte[] payload = new byte[0];

        try {
            DataReference myDataReference = dataReferenceStack.pop();
            myInputStream = myDataReference.createInputStream();
            payload = BinaryTools.readByteArray(myInputStream, (int) myDataReference.getLength());
            myInputStream.close();
            myInputStream = null;

            myInputStream = dataReferenceStack.pop().createInputStream();
View Full Code Here

Examples of com.hadoop.compression.lzo.LzopCodec.createInputStream()

    Path destFile = new Path(args[0]);

    LzopCodec codec = new LzopCodec();
    codec.setConf(config);
    InputStream is = codec.createInputStream(hdfs.open(destFile));

    readFromProtoBuf(is);
  }
}
View Full Code Here

Examples of com.twitter.hbc.test.SimpleStreamProvider.createInputStream()

  @Test
  public void testIdleProbe() throws Exception {
    SimpleStreamProvider simpleStream = new SimpleStreamProvider(messages, true, true);
    int count = 0;
    try {
      InputStream stream = simpleStream.createInputStream();
      BlockingQueue<String> queue = new ArrayBlockingQueue<String>(10);
      HosebirdMessageProcessor processor = new StringDelimitedProcessor(queue);
      processor.setup(stream);
      // read until we hit the IOException
      while (count < messages.length * 2) {
View Full Code Here

Examples of com.twitter.hbc.test.SimpleStreamProvider.createInputStream()

  @Test
  public void testIdleProbe() throws Exception {
    SimpleStreamProvider simpleStream = new SimpleStreamProvider(messages, true, true);
    int count = 0;
    try {
      InputStream stream = simpleStream.createInputStream();
      BlockingQueue<String> queue = new ArrayBlockingQueue<String>(10);
      HosebirdMessageProcessor processor = new StringDelimitedProcessor(queue);
      processor.setup(stream);
      // read until we hit the IOException
      while (count < messages.length * 2) {
View Full Code Here

Examples of org.apache.camel.component.http.helper.LoadingByteArrayOutputStream.createInputStream()

        try {
            bos = new LoadingByteArrayOutputStream();
            is = method.getResponseBodyAsStream();
            IOUtils.copy(is, bos);
            bos.flush();
            return bos.createInputStream();
        } finally {
            ObjectHelper.close(is, "Extracting response body", LOG);
            ObjectHelper.close(bos, "Extracting response body", LOG);
        }
    }
View Full Code Here

Examples of org.apache.camel.component.http.helper.LoadingByteArrayOutputStream.createInputStream()

            if (is == null) {
                return null;
            }
            IOUtils.copy(is, bos);
            bos.flush();
            return bos.createInputStream();
        } finally {
            ObjectHelper.close(is, "Extracting response body", LOG);
            ObjectHelper.close(bos, "Extracting response body", LOG);
        }
    }
View Full Code Here

Examples of org.apache.camel.component.http.helper.LoadingByteArrayOutputStream.createInputStream()

            InputStream is = method.getResponseBodyAsStream();
            IOUtils.copy(is, bos);
            bos.flush();
            is.close();
            Message message = exchange.getIn();
            message.setBody(bos.createInputStream());

            // lets set the headers
            Header[] headers = method.getResponseHeaders();
            HeaderFilterStrategy strategy = endpoint.getHeaderFilterStrategy();
            for (Header header : headers) {
View Full Code Here

Examples of org.apache.camel.component.http4.helper.LoadingByteArrayOutputStream.createInputStream()

                bos.flush();
            } finally {
                ObjectHelper.close(is, "input stream", null);
            }
            Message message = exchange.getIn();
            message.setBody(bos.createInputStream());

            // lets set the headers
            Header[] headers = response.getAllHeaders();
            HeaderFilterStrategy strategy = endpoint.getHeaderFilterStrategy();
            for (Header header : headers) {
View Full Code Here

Examples of org.apache.cxf.helpers.LoadingByteArrayOutputStream.createInputStream()

                        }

                        schemaSourcesMap.put(sch.getSourceURI() + ":"
                                             + sch.getTargetNamespace(), out.toByteArray());
                       
                        Source source = new StreamSource(out.createInputStream(), sch.getSourceURI());
                        schemaSourcesMap2.put(sch.getSourceURI() + ":"
                                              + sch.getTargetNamespace(), source);
                    }
                }
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.