1. A method for partitioning a data segment, P, with a length p into smaller segments, P i , wherein each of the smaller segments is compressed separately, the method comprising: storing the data segment, P in a computer readable storage medium; dividing the data segment, P into a plurality of 2-partition pairs π where both partitions within each pair have a predefined length of at least μ(P); estimating a compressed length of each partition within each pair; and selecting one of the 2-partition pairs it for partitioning the data segment, P, such that Γ(π)<Γ(P), where Γ(π) represents a compressed length of the one of the 2-partition pairs and Γ(P) represents a compressed length of the data segment, P, wherein at least one of: the storing, the dividing, the estimating or the selecting is performed via a processor.