/** * Returns all supported capture sizes. * * @return an array of capture sizes, in bytes, never <code>null</code>. */ public Integer[] getCaptureSizes() { final String rawValue = this.properties.get(DEVICE_CAPTURESIZES); final String[] values = rawValue.split(",\\s*"); final List<Integer> result = new ArrayList<Integer>(); for (String value : values) { result.add(Integer.valueOf(value.trim())); } Collections.sort( result, NumberUtils.<Integer>createNumberComparator(false /* aSortAscending */)); return result.toArray(new Integer[result.size()]); }
/** * Returns all supported sample rates. * * @return an array of sample rates, in Hertz, never <code>null</code>. */ public Integer[] getSampleRates() { final String rawValue = this.properties.get(DEVICE_SAMPLERATES); final String[] values = rawValue.split(",\\s*"); final SortedSet<Integer> result = new TreeSet<Integer>( NumberUtils.<Integer>createNumberComparator(false /* aSortAscending */)); for (String value : values) { result.add(Integer.valueOf(value.trim())); } return result.toArray(new Integer[result.size()]); }