@Test
public void testReadContinuedPacketOverTwoPages() throws Exception {

  byte[] firstPacket = TestUtil.buildTestData(518);
  FakeExtractorInput input =
      OggTestData.createInput(
          TestUtil.joinByteArrays(
              // First page.
              OggTestData.buildOggHeader(0x02, 0, 1000, 0x02),
              TestUtil.createByteArray(0xFF, 0xFF), // Laces.
              Arrays.copyOf(firstPacket, 510),
              // Second page (continued packet).
              OggTestData.buildOggHeader(0x05, 10, 1001, 0x01),
              TestUtil.createByteArray(0x08), // Laces.
              Arrays.copyOfRange(firstPacket, 510, 510 + 8)),
          true);
  assertReadPacket(input, firstPacket);
  assertThat((oggPacket.getPageHeader().type & 0x04) == 0x04).isTrue();
  assertThat((oggPacket.getPageHeader().type & 0x02) == 0x02).isFalse();
  assertThat(oggPacket.getPageHeader().pageSequenceNumber).isEqualTo(1001);
  assertReadEof(input);
}