EdidUtil { public static byte[][] getDescriptors(byte[] edid) { byte[][] desc = new byte[4][18]; for (int i = 0; i < desc.length; i++) { System.arraycopy(edid, 54 + 18 * i, desc[i], 0, 18); } return desc; } private  EdidUtil(); static String getManufacturerID(byte[] edid); static String getProductID(byte[] edid); static String getSerialNo(byte[] edid); static byte getWeek(byte[] edid); static int getYear(byte[] edid); static String getVersion(byte[] edid); static boolean isDigital(byte[] edid); static int getHcm(byte[] edid); static int getVcm(byte[] edid); static byte[][] getDescriptors(byte[] edid); static int getDescriptorType(byte[] desc); static String getTimingDescriptor(byte[] desc); static String getDescriptorRangeLimits(byte[] desc); static String getDescriptorText(byte[] desc); static String toString(byte[] edid);  }
@Test public void testGetDescriptors() { byte[][] descs = EdidUtil.getDescriptors(EDID); for (int i = 0; i < 4; i++) { int type = EdidUtil.getDescriptorType(descs[i]); String timing = EdidUtil.getTimingDescriptor(descs[i]); String range = EdidUtil.getDescriptorRangeLimits(descs[i]); switch (i) { case 0: assertEquals(0x565E00A0, type); assertEquals("Clock 241MHz, Active Pixels 2560x1440 ", timing); assertEquals("Field Rate -96-41 Hz vertical, 80-48 Hz horizontal, Max clock: 320 MHz", range); break; case 1: assertEquals(0x1A1D0080, type); assertEquals("Clock 74MHz, Active Pixels 1280x720 ", timing); assertEquals("Field Rate -48-28 Hz vertical, 32-64 Hz horizontal, Max clock: -1280 MHz", range); break; case 2: assertEquals(0xFF, type); assertEquals("C02JM2PFF2GC", EdidUtil.getDescriptorText(descs[i])); assertEquals(EDID_DESC3, ParseUtil.byteArrayToHexString(descs[i])); break; case 3: assertEquals(0xFC, type); assertEquals("Thunderbolt", EdidUtil.getDescriptorText(descs[i])); break; default: } } }