public static TextureObject fromStream(InputStream s)
	{
		DataInputStream d=new DataInputStream(new BufferedInputStream(s));
		d.mark(Integer.MAX_VALUE);
		try 
		{
			TextureObject ret = new TextureObject(d.readUTF(), d.readInt(), d.readInt());
			int animations = d.readInt();
			for(;animations > 0; animations--)
				ret.addAnimation(Animation.fromStream(s));
			return ret;
		}
		catch (IOException e) 
		{
			System.out.println("Could not extract TextureObject data from stream.");
			try {
				d.reset();
			} catch (IOException e1) { } //This will never happen.
			return null;
		}
	}