@Test public void testEncode() { assertEquals(0x94DC, AosFrameHeaderErrorCorr.encode(0x1234, 0x56)); assertEquals(0x457C, AosFrameHeaderErrorCorr.encode(0x369C, 0xFA)); }
public static int encode(int gvcid, int signalingField) { byte[] data = new byte[] { (byte) ((gvcid >> 12) & 0xF), (byte) ((gvcid >> 8) & 0xF), (byte) ((gvcid >> 4) & 0xF), (byte) ((gvcid) & 0xF), (byte) ((signalingField >> 4) & 0xF), (byte) ((signalingField) & 0xF) }; byte[] parity = new byte[4]; rs.encode(data, parity); return (parity[0] << 12) + (parity[1] << 8) + (parity[2] << 4) + (parity[3]); }
AosFrameHeaderErrorCorr { public static int encode(int gvcid, int signalingField) { byte[] data = new byte[] { (byte) ((gvcid >> 12) & 0xF), (byte) ((gvcid >> 8) & 0xF), (byte) ((gvcid >> 4) & 0xF), (byte) ((gvcid) & 0xF), (byte) ((signalingField >> 4) & 0xF), (byte) ((signalingField) & 0xF) }; byte[] parity = new byte[4]; rs.encode(data, parity); return (parity[0] << 12) + (parity[1] << 8) + (parity[2] << 4) + (parity[3]); } }
AosFrameHeaderErrorCorr { public static int encode(int gvcid, int signalingField) { byte[] data = new byte[] { (byte) ((gvcid >> 12) & 0xF), (byte) ((gvcid >> 8) & 0xF), (byte) ((gvcid >> 4) & 0xF), (byte) ((gvcid) & 0xF), (byte) ((signalingField >> 4) & 0xF), (byte) ((signalingField) & 0xF) }; byte[] parity = new byte[4]; rs.encode(data, parity); return (parity[0] << 12) + (parity[1] << 8) + (parity[2] << 4) + (parity[3]); }  }
AosFrameHeaderErrorCorr { public static int encode(int gvcid, int signalingField) { byte[] data = new byte[] { (byte) ((gvcid >> 12) & 0xF), (byte) ((gvcid >> 8) & 0xF), (byte) ((gvcid >> 4) & 0xF), (byte) ((gvcid) & 0xF), (byte) ((signalingField >> 4) & 0xF), (byte) ((signalingField) & 0xF) }; byte[] parity = new byte[4]; rs.encode(data, parity); return (parity[0] << 12) + (parity[1] << 8) + (parity[2] << 4) + (parity[3]); }  static int encode(int gvcid, int signalingField); static DecoderResult decode(int gvcid, int signalingField, int errControl); }
AosFrameHeaderErrorCorr { public static int encode(int gvcid, int signalingField) { byte[] data = new byte[] { (byte) ((gvcid >> 12) & 0xF), (byte) ((gvcid >> 8) & 0xF), (byte) ((gvcid >> 4) & 0xF), (byte) ((gvcid) & 0xF), (byte) ((signalingField >> 4) & 0xF), (byte) ((signalingField) & 0xF) }; byte[] parity = new byte[4]; rs.encode(data, parity); return (parity[0] << 12) + (parity[1] << 8) + (parity[2] << 4) + (parity[3]); }  static int encode(int gvcid, int signalingField); static DecoderResult decode(int gvcid, int signalingField, int errControl);  }