Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final int SYNC_BYTES_LENGTH = 4;
- final int FRAME_LENGTH = 2040;
- final int FIELD_SIZE = 256;
- byte[] frame = new byte[FRAME_LENGTH];
- InputStream is = currentThread().getContextClassLoader()
- .getResourceAsStream("S3SAMPLE.BIN");
- is.skip(SYNC_BYTES_LENGTH);
- // read a single frame
- new DataInputStream(is).readFully(frame);
- is.close();
- expected = toInterleavedUnsignedIntArrayBlocks(frame, 0).get(0);
- unencoded = toInterleavedPaddedUnsignedIntArrayBlocks(frame, 0).get(0);
- GenericGF field = new GenericGF(0x187, FIELD_SIZE, 0);
- int[] conventional = toConventional(unencoded);
- new ReedSolomonEncoder(field).encode(conventional, BLOCK_PARITY_LENGTH);
- int[] berlekamp = toBerlekamp(unencoded);
- assertArrayEquals(expected, berlekamp);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement