Package com.caucho.quercus.lib.file

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


    InputStream in = null;

    ArrayValue result = new ArrayValueImpl();

    try {
      BinaryStream stream
        = FileModule.fopen(env, filename, "r", use_include_path, null);

      if (stream == null || ! (stream instanceof BinaryInput))
        return result;
View Full Code Here


    InputStream in = null;

    ArrayValue result = new ArrayValueImpl();

    try {
      BinaryStream stream
  = FileModule.fopen(env, filename, "r", use_include_path, null);

      if (stream == null || ! (stream instanceof BinaryInput))
        return result;
View Full Code Here

                               @NotNull StringValue filename)
  {
    if (filename == null || filename.length() == 0)
      return null;

    BinaryStream s = FileModule.fopen(env, filename, "rb", false, null);

    if (s == null)
      return null;

    return new ZipDirectory((BinaryInput) s);
View Full Code Here

            array.put(LongValue.ZERO, env.wrapJava(in));
          }
          else if (type.equals("file")) {
            OutputStream processOut = process.getOutputStream();

            BinaryStream stream = FileModule.fopen(env, name, mode, false, null);

            if (stream instanceof FileInput) {
              FileInput file = (FileInput) stream;

              int ch;
              while ((ch = file.read()) >= 0) {
                processOut.write(ch);
              }
            }

            stream.close();
            processOut.close();
          }
        }
        // place to put output from the command
        else if (key.equals(LongValue.ONE)) {
          if (type.equals("pipe")) {
            out = new ProcOpenInput(env, process.getInputStream());

            array.put(LongValue.ONE, env.wrapJava(out));
          }
          else if (type.equals("file")) {
            BinaryStream stream = FileModule.fopen(env, name, mode, false, null);

            if (stream instanceof FileOutput) {
              FileOutput file = (FileOutput) stream;

              out = new ProcOpenInput(env, process.getInputStream(), file);
            }
            else if (stream != null)
              stream.close();
          }
        }
        // place to put error output from the command
        else if (key.equals(LongValue.create(2))) {
          if (type.equals("pipe")) {
            es = new ProcOpenInput(env, process.getErrorStream());

            array.put(LongValue.create(2), env.wrapJava(es));
          }
          else if (type.equals("file")) {
            BinaryStream stream = FileModule.fopen(env, name, mode, false, null);

            if (stream instanceof FileOutput) {
              FileOutput file = (FileOutput) stream;

              es = new ProcOpenInput(env, process.getErrorStream(), file);
            }
            else if (stream != null)
              stream.close();
          }
        }
      }

      return new ProcOpenResource(env, process, in, out, es, command);
View Full Code Here

                               @NotNull StringValue filename)
  {
    if (filename == null || filename.length() == 0)
      return null;

    BinaryStream s = FileModule.fopen(env, filename, "rb", false, null);

    if (s == null)
      return null;

    return new ZipDirectory((BinaryInput) s);
View Full Code Here

            array.put(LongValue.ZERO, env.wrapJava(in));
          }
          else if (type.equals("file")) {
            OutputStream processOut = process.getOutputStream();
           
            BinaryStream stream = FileModule.fopen(env, name, mode, false, null);
           
            if (stream instanceof FileInput) {
              FileInput file = (FileInput) stream;
             
              int ch;
              while ((ch = file.read()) >= 0) {
                processOut.write(ch);
              }
            }
           
            stream.close();
            processOut.close();
          }
        }
        // place to put output from the command
        else if (key.equals(LongValue.ONE)) {
          if (type.equals("pipe")) {
            out = new ProcOpenInput(env, process.getInputStream());

            array.put(LongValue.ONE, env.wrapJava(out));
          }
          else if (type.equals("file")) {
            BinaryStream stream = FileModule.fopen(env, name, mode, false, null);

            if (stream instanceof FileOutput) {
              FileOutput file = (FileOutput) stream;
             
              out = new ProcOpenInput(env, process.getInputStream(), file);
            }
            else if (stream != null)
              stream.close();
          }
        }
        // place to put error output from the command
        else if (key.equals(LongValue.create(2))) {
          if (type.equals("pipe")) {
            es = new ProcOpenInput(env, process.getErrorStream());
           
            array.put(LongValue.create(2), env.wrapJava(es));
          }
          else if (type.equals("file")) {
            BinaryStream stream = FileModule.fopen(env, name, mode, false, null);
           
            if (stream instanceof FileOutput) {
              FileOutput file = (FileOutput) stream;
             
              es = new ProcOpenInput(env, process.getErrorStream(), file);
            }
            else if (stream != null)
              stream.close();
          }
        }
      }
     
      return new ProcOpenResource(env, process, in, out, es);
View Full Code Here

    InputStream in = null;

    ArrayValue result = new ArrayValueImpl();

    try {
      BinaryStream stream
        = FileModule.fopen(env, filename, "r", use_include_path, null);

      if (stream == null || ! (stream instanceof BinaryInput))
        return result;
View Full Code Here

            array.put(LongValue.ZERO, env.wrapJava(in));
          }
          else if (type.equals("file")) {
            OutputStream processOut = process.getOutputStream();

            BinaryStream stream = FileModule.fopen(
                env, name, mode, false, null);

            if (stream instanceof FileInput) {
              FileInput file = (FileInput) stream;

              int ch;
              while ((ch = file.read()) >= 0) {
                processOut.write(ch);
              }
            }

            stream.close();
            processOut.close();
          }
        }
        // place to put output from the command
        else if (key.equals(LongValue.ONE)) {
          if (type.equals("pipe")) {
            out = new ProcOpenInput(env, process.getInputStream());

            array.put(LongValue.ONE, env.wrapJava(out));
          }
          else if (type.equals("file")) {
            BinaryStream stream = FileModule.fopen(
                env, name, mode, false, null);

            if (stream instanceof FileOutput) {
              FileOutput file = (FileOutput) stream;

              out = new ProcOpenInput(env, process.getInputStream(), file);
            }
            else if (stream != null)
              stream.close();
          }
        }
        // place to put error output from the command
        else if (key.equals(LongValue.create(2))) {
          if (type.equals("pipe")) {
            es = new ProcOpenInput(env, process.getErrorStream());

            array.put(LongValue.create(2), env.wrapJava(es));
          }
          else if (type.equals("file")) {
            BinaryStream stream = FileModule.fopen(
                env, name, mode, false, null);

            if (stream instanceof FileOutput) {
              FileOutput file = (FileOutput) stream;

              es = new ProcOpenInput(env, process.getErrorStream(), file);
            }
            else if (stream != null)
              stream.close();
          }
        }
      }

      return new ProcOpenResource(env, process, in, out, es, command);
View Full Code Here

                               @NotNull StringValue filename)
  {
    if (filename == null || filename.length() == 0)
      return null;

    BinaryStream s = FileModule.fopen(env, filename, "rb", false, null);

    if (s == null)
      return null;

    return new ZipDirectory((BinaryInput) s);
View Full Code Here

TOP

Related Classes of com.caucho.quercus.lib.file.BinaryStream

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.