asclass ShortInputStream { public int read(short[] destination) throws IOException { ret read(destination, 0, l(destination)); } public int read(short[] destination, int off, int len) throws IOException { int n = 0; while (n < len) { int i = read(); if (i == Int.MIN_VALUE) break; destination[off+n] = (short) i; n++; } ret n; } public abstract int read() throws IOException; }