class MySQLDateBinlogProtocolValue implements MySQLBinlogProtocolValue {

    @Override
    public Serializable read(final MySQLBinlogColumnDef columnDef, final MySQLPacketPayload payload) {
        int date = payload.getByteBuf().readUnsignedMediumLE();
        return 0 == date ? MySQLTimeValueUtil.ZERO_OF_DATE : String.format("%d-%02d-%02d", date / 16 / 32, date / 32 % 16, date % 32);
    }

}