code: public static InputStream getResourceAsStream(String ref) {
  		InputStream in = null;
  		
  		for (int i=0;i<locations.size();i++) {
  			ResourceLocation location = (ResourceLocation) locations.get(i);
  			in = location.getResourceAsStream(ref);
  			if (in != null) {
  				break;
  			}
  		}
  		
  		if (in == null)
  		{
  			throw new RuntimeException("Resource not found: "+ref);
  		}
  			
  		return new BufferedInputStream(in);
  	}
docs: Get a resource
  
  @param ref The reference to the resource to retrieve
  @return A stream from which the resource can be read