public int[] readAll() throws IOException {
   byte[] all = IOs.readAsByteArray(dis);
   return Bytes.toReducedBitIntArray(
       all,
       all.length,
       format.getBytePerSample(),
       format.getSampleSizeInBits(),
       format.isBigEndian());
 }
 public int[] readSamplesAsIntArray(int amount) throws IOException {
   byte[] bytez = new byte[amount * format.getBytePerSample()];
   int readAmount = dis.read(bytez);
   if (readAmount == -1) return new int[0];
   return Bytes.toReducedBitIntArray(
       bytez,
       readAmount,
       format.getBytePerSample(),
       format.getSampleSizeInBits(),
       format.isBigEndian());
 }