public static XLogPack getTranxData(File xlogDir, StyledText header, int serverId) { String xlogPath = xlogDir.getAbsolutePath() + "/" + xLogFileName; File xlogFile = new File(xlogPath); if (!xlogFile.canRead()) { return null; } byte[] xlogb = new byte[(int) xlogFile.length()]; try { FileInputStream xlogInputStream = new FileInputStream(xlogFile); xlogInputStream.read(xlogb); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } DataInputX inX = new DataInputX(xlogb); XLogPack p = null; try { p = (XLogPack) inX.readPack(); } catch (IOException e) { e.printStackTrace(); } String date = DateUtil.yyyymmdd(p.endTime); if (p != null) { ProfileTextFull.buildXLogData(date, header, p, serverId); } return p; }
public static void setProfileData( XLogPack pack, StepWrapper[] profiles, StyledText text, int pageNum, int rowPerPage, Button prevBtn, Button nextBtn, Button startBtn, Button endBtn, int length, int serverId, int searchLineIndex, boolean isSummary) { String date = DateUtil.yyyymmdd(pack.endTime); int total = (profiles.length / rowPerPage) + 1; if (profiles.length % rowPerPage == 0) { total = total - 1; } if (pageNum > total) { pageNum = total - 1; } ProfileTextFull.buildProfile( date, text, pack, profiles, pageNum, rowPerPage, prevBtn, nextBtn, startBtn, endBtn, length, serverId, searchLineIndex, isSummary); }