Package com.stuffwithstuff.magpie.util

Examples of com.stuffwithstuff.magpie.util.FileReader.readAll()


  @Doc("Reads the contents of the file as a string.")
  public static class Read implements Intrinsic {
    public Obj invoke(Context context, Obj left, Obj right) {
      FileReader reader = (FileReader)left.getValue();
      try {
        String contents = reader.readAll();
        if (contents == null) return context.nothing();
        return context.toObj(contents);
      } catch (IOException e) {
        throw context.error("IOError", "Could not read.");
      }
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.