void loadConstants(Prototype f) throws IOException {
  int n=loadInt();
  LuaValue[] values=n > 0 ? new LuaValue[n] : NOVALUES;
  for (int i=0; i < n; i++) {
switch (is.readByte()) {
case LUA_TNIL:
      values[i]=LuaValue.NIL;
    break;
case LUA_TBOOLEAN:
  values[i]=(0 != is.readUnsignedByte() ? LuaValue.TRUE : LuaValue.FALSE);
break;
case LUA_TINT:
values[i]=LuaInteger.valueOf(loadInt());
break;
case LUA_TNUMBER:
values[i]=loadNumber();
break;
case LUA_TSTRING:
values[i]=loadString();
break;
default :
throw new IllegalStateException("bad constant");
}
}
f.k=values;
n=loadInt();
Prototype[] protos=n > 0 ? new Prototype[n] : NOPROTOS;
for (int i=0; i < n; i++) protos[i]=loadFunction(f.source);
f.p=protos;
}

void loadConstants ( Prototype f ) throws IOException { int n = loadInt ( ) ; LuaValue [ ] values = n > 0 ? new LuaValue [ n ] : NOVALUES ; for ( int i = 0 ; i < n ; i ++ ) { switch ( is . readByte ( ) ) { case LUA_TNIL : values [ i ] = LuaValue . NIL ; break ; case LUA_TBOOLEAN : values [ i ] = ( 0 != is . readUnsignedByte ( ) ? LuaValue . TRUE : LuaValue . FALSE ) ; break ; case LUA_TINT : values [ i ] = LuaInteger . valueOf ( loadInt ( ) ) ; break ; case LUA_TNUMBER : values [ i ] = loadNumber ( ) ; break ; case LUA_TSTRING : values [ i ] = loadString ( ) ; break ; default : throw new IllegalStateException ( "bad constant" ) ; } } f . k = values ; n = loadInt ( ) ; Prototype [ ] protos = n > 0 ? new Prototype [ n ] : NOPROTOS ; for ( int i = 0 ; i < n ; i ++ ) protos [ i ] = loadFunction ( f . source ) ; f . p = protos ; }
load a list of constants from a binary chunk
