private long getVariable(long length, IsoBufferWrapper in) throws IOException {
   long ret;
   if (((length + 1) * 8) == 8) {
     ret = in.readUInt8();
   } else if (((length + 1) * 8) == 16) {
     ret = in.readUInt16();
   } else if (((length + 1) * 8) == 24) {
     ret = in.readUInt24();
   } else if (((length + 1) * 8) == 32) {
     ret = in.readUInt32();
   } else if (((length + 1) * 8) == 64) {
     ret = in.readUInt64();
   } else {
     throw new IOException("lengthSize not power of two");
   }
   return ret;
 }