Index: trunk/nv/lua/lua_raw.hh
===================================================================
--- trunk/nv/lua/lua_raw.hh	(revision 219)
+++ trunk/nv/lua/lua_raw.hh	(revision 220)
@@ -11,4 +11,5 @@
 #include <istream>
 #include <string>
+#include <vector>
 #include <map>
 
@@ -26,4 +27,6 @@
 void nlua_tokeyset( lua_State *L, int index );
 
+std::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index );
+
 void nlua_register( lua_State *L, const char* fname, lua_CFunction func, int index );
 void nlua_register( lua_State *L, const luaL_Reg *l, int index );
Index: trunk/src/lua/lua_raw.cc
===================================================================
--- trunk/src/lua/lua_raw.cc	(revision 219)
+++ trunk/src/lua/lua_raw.cc	(revision 220)
@@ -248,2 +248,18 @@
 	}
 }
+
+std::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index )
+{
+	index = lua_absindex( L, index );
+	std::vector<nv::uint8> result;
+	if ( lua_istable( L, index ) )
+	{
+		lua_pushnil( L );
+		while ( lua_next( L, index ) != 0 )
+		{
+			result.push_back( (nv::uint8) lua_tointeger( L, -1 ) );
+			lua_pop( L, 1 );
+		}
+	}
+	return result;
+}
