LuaValue[] args = new LuaValue[4 + statement.getFunctionArgs().length];
args[0] = lua.getFunction(statement.getFunctionName());
args[1] = LuaInteger.valueOf(2);
args[2] = new LuaInputStream(inputQueue);
args[3] = new LuaOutputStream(resultSet);
int count = 4;
for (Value value : statement.getFunctionArgs()) {
args[count++] = value.getLuaValue(lua);
}