1. A method for encoding data, comprising: encoding, using encoding circuitry, a first portion of the data based on a constrained code to provide a first constrained sequence; computing an error correction syndrome based on the first constrained sequence and a first portion of an error correction code (ECC); encoding a second portion of the data based on the constrained code, the computed error correction syndrome, and a second portion of the ECC, to generate a second constrained sequence, wherein a concatenation of the first and second constrained sequences forms at least a portion of an ECC codeword.