public static Vector[] processHistoryJPHA(String selected) throws IOException {
        Vector<HistoryItem> localVector = new Vector<HistoryItem>();
        Vector<HistoryItem> localVector2 = new Vector<HistoryItem>();
        File localFile = new File(selected);
        DataInputStream localDataInputStream;
        if (localFile.length() > 0L)
          {
            localDataInputStream = new DataInputStream(new FileInputStream(localFile));
            // read JPHA header

            localDataInputStream.readUTF();
            // read UIN of profile
            String uin = localDataInputStream.readUTF();
              while (localDataInputStream.available() > 0)
              {
                  // read UIN of contact
                  String contactuin = localDataInputStream.readUTF();
                  if (contactuin.equals(""))
                      {
                      // readUTF() reads two bytes ( they point to length of string ). These two for those cases when between uin and length pointer are more than 4 bytes.
                      contactuin = localDataInputStream.readUTF();
                      contactuin = localDataInputStream.readUTF();
                      }
                  // read length of hst/cache file. 4 bytes.
                  int length = localDataInputStream.readInt();                        
                  if (length == 0)
                  {
                      continue;
                  }
                  else
                  {
                      // we are going to process cache file.
                      int u = 0;
                      // u will store number of bytes read
                      while(u < length)
                      {
                        // we can just skip cache because all info in cache already in hst file
                            
                        // skip xtraz, recieved flag, 8 bytes of data
                        localDataInputStream.skip(10L);
                        // length of string
                        int j = localDataInputStream.readInt();
                        localDataInputStream.skip(j);
                        u = u + 14 + j;
                        
                      }
                      // proccessing hst file. Just like previous one.
                      int lengthhst = localDataInputStream.readInt();
                      int uhst = 0;
                      while(uhst < lengthhst)
                      {
                        int i = localDataInputStream.readByte();
                        boolean bool = localDataInputStream.readBoolean();
                        long l = localDataInputStream.readLong();
                        int j = localDataInputStream.readInt();
                        byte[] arrayOfByte = new byte[j];
                        localDataInputStream.read(arrayOfByte, 0, j);
                        String str2 = new String(arrayOfByte, "windows-1251");                        

                        HistoryItem messageContainer = new HistoryItem();
                        messageContainer.contactuin = contactuin.toString();
                        messageContainer.myuin = uin;
                        messageContainer.direction = i;
                        messageContainer.confirmed = true;
                        messageContainer.message = str2;
                        messageContainer.date = l;
                        messageContainer.isXtrazMessage = bool;                      
                        
                        localVector2.add(messageContainer);
                        uhst = uhst + 14 + j;
                        
                      }
                  }
          
              }
          }

    return new Vector[] {localVector,localVector2};
}