Package com.caucho.quercus.lib.file

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


        = FileModule.fopen(env, filename, "r", use_include_path, null);

      if (stream == null || ! (stream instanceof BinaryInput))
        return result;

      BinaryInput input = (BinaryInput) stream;

      while (! input.isEOF()) {
        String tag = getNextTag(input);

        if (tag.equalsIgnoreCase("meta")) {
          String name = null;
          String content = null;
View Full Code Here


  = FileModule.fopen(env, filename, "r", use_include_path, null);

      if (stream == null || ! (stream instanceof BinaryInput))
        return result;

      BinaryInput input = (BinaryInput) stream;

      while (! input.isEOF()) {
        String tag = getNextTag(input);

        if (tag.equalsIgnoreCase("meta")) {
          String name = null;
          String content = null;
View Full Code Here

   * Sets the position.
   */
  public boolean setPosition(long offset)
  {
    try {
      BinaryInput newIn = _in.openCopy();
     
      /*
      _gzIn.close();
      getInputStream().close();
     
View Full Code Here

    try {
      int ch = filemode.charAt(0);

      if (ch == 'r') {
        BinaryInput is = (BinaryInput) val;
        return new ZlibInputStream(env, is);
      }
      else if (ch == 'w') {
        return new ZlibOutputStream(((BinaryOutput) val).getOutputStream(),
            compressionLevel,
View Full Code Here

  @ReturnNullAsFalse
  public static ArrayValue gzfile(Env env,
          StringValue fileName,
          @Optional boolean useIncludePath)
  {
    BinaryInput is = (BinaryInput) gzopen(env, fileName, "r", useIncludePath);

    if (is == null)
      return null;

    try {
      ArrayValue result = new ArrayValueImpl();

      StringValue line;
      while ((line = is.readLine(Integer.MAX_VALUE)) != null &&
       line.length() > 0)
  result.put(line);

      return result;
    } catch (IOException e) {
      throw new QuercusModuleException(e);
    } finally {
      is.close();
    }
  }
View Full Code Here

   */
  public static Value readgzfile(Env env,
         StringValue fileName,
         @Optional boolean useIncludePath)
  {
    BinaryInput is = (BinaryInput) gzopen(env, fileName, "r", useIncludePath);

    if (is == null)
      return BooleanValue.FALSE;

    try {
      return LongValue.create(env.getOut().writeStream(is.getInputStream()));
    } catch (IOException e) {
      throw new QuercusModuleException(e);
    } finally {
      is.close();
    }
  }
View Full Code Here

    HttpConnection conn = getHttpConnection();
    OutputStream out = conn.getOutputStream();

    CurlResource curl = getCurlResource();

    BinaryInput in = curl.getUploadFile();
    int length = curl.getUploadFileSize();

    for (int i = 0; i < length; i++) {
      int ch = in.read();

      if (ch < 0)
        break;

      out.write(ch);
View Full Code Here

    HttpConnection conn = getHttpConnection();
    OutputStream out = conn.getOutputStream();

    CurlResource curl = getCurlResource();

    BinaryInput in = curl.getUploadFile();
    int length = curl.getUploadFileSize();

    for (int i = 0; i < length; i++) {
      int ch = in.read();

      if (ch < 0)
        break;

      out.write(ch);
View Full Code Here

   * Sets the position.
   */
  public boolean setPosition(long offset)
  {
    try {
      BinaryInput newIn = _in.openCopy();
     
      /*
      _gzIn.close();
      getInputStream().close();
     
View Full Code Here

    try {
      int ch = filemode.charAt(0);

      if (ch == 'r') {
        BinaryInput is = (BinaryInput) val;
        return new ZlibInputStream(env, is);
      }
      else if (ch == 'w') {
        return new ZlibOutputStream(((BinaryOutput) val).getOutputStream(),
                                    compressionLevel,
View Full Code Here

TOP

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

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.