public synchronized void getRange() throws Exception {
final Descriptor range = new Descriptor(TARGET_ID, 1, new SortedRangeSet("1-10"));
m_task.getDescriptor(new InputStream() {
int m_count = 0;
byte[] m_bytes = (range.toRepresentation() + "
").getBytes();
@Override
public int read() throws IOException {
if (m_count < m_bytes.length) {
byte b = m_bytes[m_count];
m_count++;
return b;
} else {
return -1;
}
}
});
}
|