Examples of BinaryInput


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

  @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

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

   */
  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

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

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

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

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

    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

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

  @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

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

   */
  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

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

    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

Examples of org.apache.manifoldcf.core.interfaces.BinaryInput

          String value = (String) x;
          // letting database do lame conversion!
          ps.setString(i + 1, value);
        }
        if (x instanceof BinaryInput) {
          BinaryInput value = (BinaryInput) x;
          // System.out.println("Blob length on write = "+Long.toString(value.getLength()));
          // The oracle driver does a binary conversion to base 64 when writing data
          // into a clob column using a binary stream operator.  Since at this
          // point there is no way to distinguish the two, and since our tests use CLOB,
          // this code doesn't work for them.
          // So, for now, use the ascii stream method.
          //ps.setBinaryStream(i+1,value.getStream(),(int)value.getLength());
          ps.setAsciiStream(i + 1, value.getStream(), (int) value.getLength());
        }
        if (x instanceof java.util.Date) {
          ps.setDate(i + 1, new java.sql.Date(((java.util.Date) x).getTime()));
        }
        if (x instanceof Long) {
View Full Code Here

Examples of org.apache.manifoldcf.core.interfaces.BinaryInput

          String value = (String) x;
          // letting database do lame conversion!
          ps.setString(i + 1, value);
        }
        if (x instanceof BinaryInput) {
          BinaryInput value = (BinaryInput) x;
          // System.out.println("Blob length on write = "+Long.toString(value.getLength()));
          // The oracle driver does a binary conversion to base 64 when writing data
          // into a clob column using a binary stream operator.  Since at this
          // point there is no way to distinguish the two, and since our tests use CLOB,
          // this code doesn't work for them.
          // So, for now, use the ascii stream method.
          //ps.setBinaryStream(i+1,value.getStream(),(int)value.getLength());
          ps.setAsciiStream(i + 1, value.getStream(), (int) value.getLength());
        }
        if (x instanceof java.util.Date) {
          ps.setDate(i + 1, new java.sql.Date(((java.util.Date) x).getTime()));
        }
        if (x instanceof Long) {
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.