Patent ID: 7783781

Claim:
A network device for communicating a file over a network, comprising: a transceiver to send and receive data over the network; and a compression component that is programmed to perform actions comprising: receiving the file; compressing at least a portion of the file into a buffer using a first compression mode to create a compressed block; if the compression of at least the portion of the file using the first compression mode results in the file being completely compressed into the buffer, determining an adjusted file length for the file, based, in part, on the size of the compressed block, and sending the compressed block and the adjusted file length to a destination; and if the compression of at least the portion of the file using the first compression mode results in the file being incompletely compressed into the buffer, determining an expected file length for the file based, in part, on a remaining portion of the file that is currently uncompressed based on a second compression mode, wherein the first compression mode and the second compression mode are different from each other; sending the compressed block and the expected file length towards the destination; compressing the remaining portion of the file into at least one additional compressed block using the second compression mode, and sending the at least one additional compressed block towards the destination.