code: private Iterable<Version> loadData(InputStream in) throws IOException, StreamCorruptedException {
          DataInputStream dis = new DataInputStream(in);
          if (dis.readByte() != 1) {
              throw new StreamCorruptedException("File format not recognised");
          }
          // group
          String groupId = dis.readUTF();
          if ("TZDB".equals(groupId) == false) {
              throw new StreamCorruptedException("File format not recognised");
          }
          // versions
          int versionCount = dis.readShort();
          String[] versionArray = new String[versionCount];
          for (int i = 0; i < versionCount; i++) {
              versionArray[i] = dis.readUTF();
          }
          // regions
          int regionCount = dis.readShort();
          String[] regionArray = new String[regionCount];
          for (int i = 0; i < regionCount; i++) {
              regionArray[i] = dis.readUTF();
          }
          regionIds = Arrays.asList(regionArray);
          // rules
          int ruleCount = dis.readShort();
          Object[] ruleArray = new Object[ruleCount];
          for (int i = 0; i < ruleCount; i++) {
              byte[] bytes = new byte[dis.readShort()];
              dis.readFully(bytes);
              ruleArray[i] = bytes;
          }
          AtomicReferenceArray<Object> ruleData = new AtomicReferenceArray<Object>(ruleArray);
          // link version-region-rules
          Set<Version> versionSet = new HashSet<Version>(versionCount);
          for (int i = 0; i < versionCount; i++) {
              int versionRegionCount = dis.readShort();
              String[] versionRegionArray = new String[versionRegionCount];
              short[] versionRulesArray = new short[versionRegionCount];
              for (int j = 0; j < versionRegionCount; j++) {
                  versionRegionArray[j] = regionArray[dis.readShort()];
                  versionRulesArray[j] = dis.readShort();
              }
              versionSet.add(new Version(versionArray[i], versionRegionArray, versionRulesArray, ruleData));
          }
          return versionSet;
      }
docs: Loads the rules from an input stream.
  
  @param in  the stream to load, not null, not closed after use
  @throws Exception if an error occurs