comparison src/luan/lib/Utils.java @ 86:6db8f286fa6c

_ENV is per module, not global git-svn-id: https://luan-java.googlecode.com/svn/trunk@87 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Wed, 27 Feb 2013 08:03:51 +0000
parents aa7538ae5fb6
children 6ca02b188dba
comparison
equal deleted inserted replaced
85:b2551f00bc51 86:6db8f286fa6c
4 import java.io.FileReader; 4 import java.io.FileReader;
5 import java.io.InputStreamReader; 5 import java.io.InputStreamReader;
6 import java.io.Reader; 6 import java.io.Reader;
7 import java.io.IOException; 7 import java.io.IOException;
8 import java.net.URL; 8 import java.net.URL;
9 import luan.LuanState;
10 import luan.LuanException;
11 import luan.LuanElement;
9 12
10 13
11 public final class Utils { 14 public final class Utils {
12 private Utils() {} // never 15 private Utils() {} // never
16
17 public static void checkNotNull(LuanState luan,Object v,String expected) throws LuanException {
18 if( v == null )
19 throw new LuanException(luan,LuanElement.JAVA,"bad argument #1 ("+expected+" expected, got nil)");
20 }
13 21
14 public static String readAll(Reader in) 22 public static String readAll(Reader in)
15 throws IOException 23 throws IOException
16 { 24 {
17 char[] a = new char[8192]; 25 char[] a = new char[8192];