Patent ID: 7292607

Claim:
A method for aligning data in a data stream along a boundary between two bytes X1 and X2, the data stream comprising N consecutive X1 bytes followed by N consecutive X2 bytes, the method comprising the steps of: storing a first M bytes of data, where M is smaller than N; monitoring at least a subsequent second M bytes of data, wherein the first M bytes of data and the second M bytes of data are from sequential segments of the data stream; comparing each of said first M bytes to a value X1*, wherein X1* represents X1 or any value resulting from a bit shift of X1; comparing each of said second M bytes to a value X2*, wherein X2* represents X2 or any value resulting from a bit shift of X2; detecting an X1X2boundary when each of said first M bytes equals X1* and each of said second M bytes equals X2*; and aligning the data stream along the detected X1X2 boundary to an extent to which the X1X2 boundary is byte shifted from an end point of the data stream such that said first M bytes are on one side of the X1X2 boundary and said second M bytes are on an opposite side of the X1X2 boundary.