SimplePullDataSource implements ISageTVDataSource { String getHost(String uri) { if (uri == null) return null; if (uri.startsWith("stv:")) { int s = "stv: int pos = uri.indexOf("/", s); if (pos != -1) { return uri.substring(s, pos); } } return host; } SimplePullDataSource();  SimplePullDataSource(String host); String getUri(); @Override long open(String uri); @Override void close(); @Override long size(); boolean isOpen(); @Override int read(long position, byte[] buffer, int offset, int len); int fetch(long position, byte[] buffer, int offset, int len);  }
@Test public void testGetHost() throws Exception { SimplePullDataSource ds = new SimplePullDataSource(); assertEquals("192.168.1.10", ds.getHost("stv: assertEquals("192.168.2.10", ds.getHost("stv: }