InclusiveByteRange { public static String to416HeaderRangeString(long size) { StringBuilder sb = new StringBuilder(40); sb.append("bytes */"); sb.append(size); return sb.toString(); } InclusiveByteRange(long first, long last); long getFirst(); long getLast(); long getSize(); String toHeaderRangeString(long size); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); static List<InclusiveByteRange> satisfiableRanges(List<String> headers, long size); static List<InclusiveByteRange> satisfiableRanges(Enumeration<String> headers, long size); static String to416HeaderRangeString(long size); static final LazyLogger LOG; }
@Test public void testHeader416RangeString() { assertEquals("bytes */100", InclusiveByteRange.to416HeaderRangeString(100), "416 Header on size 100"); assertEquals("bytes */123456789", InclusiveByteRange.to416HeaderRangeString(123456789), "416 Header on size 123456789"); }