contract StaticResource{ @Description("获取Scanner,参考:java.util.Scanner") export function asScanner(args){ var scanner = Global.Resources.loadAsScanner("/local.txt"); return scanner.nextLine(); } @Description("字符串类型") export function asString(args){ var str = Global.Resources.loadAsString("/local.txt"); return str; } @Description("流类型") export function asInputStream(args){ var stream = Global.Resources.loadAsInputStream("/local.txt"); return stream.available(); } }