Package com.caucho.vfs

Examples of com.caucho.vfs.WriteStream


  }

  public static void writeFile(Path path, Path file)
  throws Throwable
  {
    WriteStream s = path.openWrite();

    try {
      s.writeFile(file);
    } finally {
      s.close();
    }
  }
View Full Code Here


  }

  public static void append(Path path, Call call, int length)
  throws Throwable
  {
    WriteStream s = path.openAppend();

    try {
      for (int i = 0; i < length; i++) {
        String string = call.getArgString(i, length);

        s.print(string);
      }
    } finally {
      s.close();
    }
  }
View Full Code Here

  }

  public static void appendln(Path path, Call call, int length)
  throws Throwable
  {
    WriteStream s = path.openAppend();

    try {
      for (int i = 0; i < length; i++) {
        String string = call.getArgString(i, length);

        s.print(string);
      }

      s.print('\n');
    } finally {
      s.close();
    }
  }
View Full Code Here

  }

  public static void appendStream(Path path, InputStream is)
  throws Throwable
  {
    WriteStream s = path.openAppend();

    try {
      s.writeStream(is);
    } finally {
      s.close();
    }
  }
View Full Code Here

  }

  public static void appendFile(Path path, Path file)
  throws Throwable
  {
    WriteStream s = path.openAppend();

    try {
      s.writeFile(file);
    } finally {
      s.close();
    }
  }
View Full Code Here

  }

  public static void write(ReadWritePair s, Call call, int length)
  throws Throwable
  {
    WriteStream os = s.getWriteStream();
    for (int i = 0; i < length; i++) {
      String string = call.getArgString(i, length);

      os.print(string);
    }
  }
View Full Code Here

  }

  public static void writeln(ReadWritePair s, Call call, int length)
  throws Throwable
  {
    WriteStream os = s.getWriteStream();
    for (int i = 0; i < length; i++) {
      String string = call.getArgString(i, length);

      os.print(string);
    }

    os.println();
  }
View Full Code Here

  throws Throwable
  {
    if (length < 1)
      return;

    WriteStream os = s.getWriteStream();
    Object obj = call.getArgObject(0, length);

    if (obj instanceof InputStream)
      os.writeStream((InputStream) obj);
    else if (obj instanceof ReadWritePair)
      os.writeStream(((ReadWritePair) obj).getReadStream());
    else
      throw new IllegalArgumentException("expected read stream at " +
                                         obj.getClass().getName());
  }
View Full Code Here

    throws Throwable
  {
    if (length == 0)
      return;

    WriteStream os = s.getWriteStream();
    String result = eval.printf(length);
   
    os.print(result);
  }
View Full Code Here

    synchronized (LOCK) {
      Path path = workPath.lookup(className.replace('.', '/') + ".java");
      path.getParent().mkdirs();
   
      WriteStream os = path.openWrite();
      os.setEncoding("JAVA");
      parseClass.writeCode(os);
      os.close();

      Script script;
      try {
        compiler.compile(className.replace('.', '/') + ".java", null);
        script = loadScript(className);
View Full Code Here

TOP

Related Classes of com.caucho.vfs.WriteStream

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.