private static Type decodeType(int dataType) throws IOException {
    Type result;

    switch (dataType) {
    case 0: result = Type.U8    ; break;
    case 1: result = Type.STRING; break;
    case 2: result = Type.U16   ; break;
    case 3: result = Type.U32   ; break;
    case 4: result = Type.X8    ; break;
    case 5: result = Type.ONE   ; break;
    case 6: result = Type.TWO   ; break;
    default:
      throw new IOException("Unknown data type.");
    }

    return result;
  }