Package java.io

Examples of java.io.SequenceInputStream


            encodeParam.setICCProfileName(iccProfileName);
        }

        // Parse prior IDAT chunks
        InputStream seqStream =
            new SequenceInputStream(streamVec.elements());
        InputStream infStream =
            new InflaterInputStream(seqStream, new Inflater());
        dataStream = new DataInputStream(infStream);

        // Create an empty WritableRaster
View Full Code Here


       
        invokeMethod(rubyInstanceConfig, "processArguments", (Object) arguments);
       
        Object runtime = invokeMethod(scriptingContainer, "getRuntime");
        Object executableInput =
            new SequenceInputStream(new ByteArrayInputStream(executableScriptEnvPrefix().getBytes()),
                                    (InputStream) invokeMethod(rubyInstanceConfig, "getScriptSource"));
       
        debug("invoking " + executablePath + " with: " + Arrays.toString(executableArgv));
       
        Object outcome = invokeMethod(runtime, "runFromMain",
View Full Code Here

            if (remaining == 0) {
                break;
            }
        }
        reuseBuffers = false;
        return new SequenceInputStream(Collections.enumeration(list));
    }
View Full Code Here

      if (debug) {
        dumpResponseHeader(u);
      }
      InputStream cg = conn.getInputStream();
      InputStream prefix = new ByteArrayInputStream("HG10GZ".getBytes()); // didn't see any other that zip
      return new SequenceInputStream(prefix, cg);
    } catch (MalformedURLException ex) {
      // although there's little user can do about this issue (URLs are constructed by our code)
      // it's still better to throw it as checked exception than RT because url is likely malformed due to parameters
      // and this may help user to understand the cause (and e.g. change them)
      throw new HgRemoteConnectionException("Bad URL", ex).setRemoteCommand("changegroup").setServerInfo(getServerLocation());
View Full Code Here

 
  public InputStream changegroup(List<Nodeid> roots) throws HgRemoteConnectionException, HgRuntimeException {
    String l = join(roots, ' ');
    InputStream cg = executeCommand("changegroup", Collections.singletonList(new Parameter("roots", l)), false);
    InputStream prefix = new ByteArrayInputStream("HG10UN".getBytes());
    return new SequenceInputStream(prefix, cg);
  }
View Full Code Here

    private static void init(String defaultLogProperties)
            throws IOException {
        InputStream defaultStream = null;
        InputStream resourceStream = null;
        InputStream configFileStream = null;
        SequenceInputStream combinedStream = null;
       
        try {
            defaultStream = getInputStreamFromFilename(
                System.getProperty("java.home") + File.separator +
                "lib" + File.separator + "logging.properties");
            resourceStream = ClassLoader.getSystemResourceAsStream(
                defaultLogProperties);
            configFileStream = getInputStreamFromFilename(
                System.getProperty("java.util.logging.config.file"));
       
            Vector<InputStream> streamList = new Vector<InputStream>(3);
            streamList.add(defaultStream);
            if (resourceStream != null) {
                streamList.add(resourceStream);
            }
            if (configFileStream != null) {
                streamList.add(configFileStream);
            }

            combinedStream = new SequenceInputStream(streamList.elements());
            LogManager.getLogManager().readConfiguration(combinedStream);
        } finally {
            close(combinedStream);
            close(configFileStream);
            close(resourceStream);
View Full Code Here

            encodeParam.setCompressedText(ztextArray);
        }

        // Parse prior IDAT chunks
        InputStream seqStream =
            new SequenceInputStream(streamVec.elements());
        InputStream infStream =
            new InflaterInputStream(seqStream, new Inflater());
        dataStream = new DataInputStream(infStream);
       
        // Create an empty WritableRaster
View Full Code Here

          in.reset();
          parseWritable(in);
        } else {
          // We cannot use BufferedInputStream, it consumes more than we read from the underlying IS
          ByteArrayInputStream bais = new ByteArrayInputStream(pbuf);
          SequenceInputStream sis = new SequenceInputStream(bais, in); // Concatenate input streams
          // TODO: Am I leaking anything here wrapping the passed in stream?  We are not calling close on the wrapped
          // streams but they should be let go after we leave this context?  I see that we keep a reference to the
          // passed in inputstream but since we no longer have a reference to this after we leave, we should be ok.
          parseWritable(new DataInputStream(sis));
        }
View Full Code Here

        hri.readFields(in);
        return hri;
      } else {
        //we cannot use BufferedInputStream, it consumes more than we read from the underlying IS
        ByteArrayInputStream bais = new ByteArrayInputStream(pbuf);
        SequenceInputStream sis = new SequenceInputStream(bais, in); //concatenate input streams
        HRegionInfo hri = new HRegionInfo();
        hri.readFields(new DataInputStream(sis));
        return hri;
      }
    }
View Full Code Here

        if(hasseparator && (i < sublen))
        {
          streams[++streamCounter] = new separatorInputStream(_separator);
        }
      }
      return new SequenceInputStream(new ArrayEnumeration<InputStream>(streams));
    }
View Full Code Here

TOP

Related Classes of java.io.SequenceInputStream

Copyright © 2018 www.massapicom. 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.