001package net.bramp.ffmpeg.nut;
002
003import com.google.common.base.MoreObjects;
004import java.io.IOException;
005
006public class PacketFooter {
007  int checksum;
008
009  public void read(NutDataInputStream in) throws IOException {
010    long expected = in.getCRC();
011    checksum = in.readInt();
012    if (checksum != expected) {
013      // throw new IOException(String.format("invalid packet checksum %X want %X", expected,
014      // checksum));
015      Packet.LOG.debug("invalid packet checksum {} want {}", expected, checksum);
016    }
017    in.resetCRC();
018  }
019
020  @Override
021  public String toString() {
022    return MoreObjects.toStringHelper(this).add("checksum", checksum).toString();
023  }
024}