comparison src/luan/lib/PickleCon.java @ 150:f35c50027985

make load() more consistent git-svn-id: https://luan-java.googlecode.com/svn/trunk@151 21e917c8-12df-6dd8-5cb6-c86387c605b9
author fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9>
date Mon, 16 Jun 2014 10:11:48 +0000
parents f99fd64291b3
children
comparison
equal deleted inserted replaced
149:f99fd64291b3 150:f35c50027985
25 private final LuanFunction _read_binary; 25 private final LuanFunction _read_binary;
26 final LuanTable ioModule; 26 final LuanTable ioModule;
27 private final DataOutputStream out; 27 private final DataOutputStream out;
28 private final List<byte[]> binaries = new ArrayList<byte[]>(); 28 private final List<byte[]> binaries = new ArrayList<byte[]>();
29 String src; 29 String src;
30 private final LuanTable env; 30 private final LuanTable env = new LuanTable();
31 31
32 PickleCon(LuanState luan,DataInputStream in,DataOutputStream out) { 32 PickleCon(LuanState luan,DataInputStream in,DataOutputStream out) {
33 this.in = in; 33 this.in = in;
34 this.luan = luan; 34 this.luan = luan;
35 try { 35 try {
38 ); 38 );
39 } catch(NoSuchMethodException e) { 39 } catch(NoSuchMethodException e) {
40 throw new RuntimeException(e); 40 throw new RuntimeException(e);
41 } 41 }
42 this.ioModule = (LuanTable)luan.loaded().get("Io"); 42 this.ioModule = (LuanTable)luan.loaded().get("Io");
43 this.env = new LuanTable(luan.global());
44 43
45 this.out = out; 44 this.out = out;
46 } 45 }
47 46
48 public byte[] _read_binary(int size) throws IOException, LuanException { 47 public byte[] _read_binary(int size) throws IOException, LuanException {