LZ77 implement for Java