public Prototype undump(InputStream stream,String chunkname) throws IOException {
  if (stream.read() != LUA_SIGNATURE[0] || stream.read() != LUA_SIGNATURE[1] || stream.read() != LUA_SIGNATURE[2] || stream.read() != LUA_SIGNATURE[3])   return null;
  String sname=getSourceName(chunkname);
  LoadState s=new LoadState(stream,sname);
  s.loadHeader();
switch (s.luacNumberFormat) {
case NUMBER_FORMAT_FLOATS_OR_DOUBLES:
case NUMBER_FORMAT_INTS_ONLY:
case NUMBER_FORMAT_NUM_PATCH_INT32:
    break;
default :
  throw new LuaError("unsupported int size");
}
return s.loadFunction(LuaString.valueOf(sname));
}

public Prototype undump ( InputStream stream , String chunkname ) throws IOException { if ( stream . read ( ) != LUA_SIGNATURE [ 0 ] || stream . read ( ) != LUA_SIGNATURE [ 1 ] || stream . read ( ) != LUA_SIGNATURE [ 2 ] || stream . read ( ) != LUA_SIGNATURE [ 3 ] ) return null ; String sname = getSourceName ( chunkname ) ; LoadState s = new LoadState ( stream , sname ) ; s . loadHeader ( ) ; switch ( s . luacNumberFormat ) { case NUMBER_FORMAT_FLOATS_OR_DOUBLES : case NUMBER_FORMAT_INTS_ONLY : case NUMBER_FORMAT_NUM_PATCH_INT32 : break ; default : throw new LuaError ( "unsupported int size" ) ; } return s . loadFunction ( LuaString . valueOf ( sname ) ) ; }
load input stream as a lua binary chunk if the first 4 bytes are the lua binary signature .
