DEV Community

loading...

Compress String with Run Length Encoding in Java

loizenai profile image loizenai ・1 min read

https://grokonez.com/java/compress-string-run-length-encoding-java

Compress String with Run Length Encoding in Java

In this Java example, we're gonna know how to compress String in Java with Run Length Encoding (RLE) method.

Related Posts:

Run Length Encoding

  • RLE is a very simple form of data compression.
  • It produces sequences in which the same data values occurs in data elements are stored as a single data value and a counter. For example, AAABB => 3A2B.
  • RLE is suitable to use for:
  • palette-based bitmap images such as computer icons or
  • black points collection on a solid white background for example:

run-length-encoding-java

Implementation

Encoding is very simple. For decoding, we use Regular Expression - Regex.

More at:
https://grokonez.com/java/compress-string-run-length-encoding-java

Compress String with Run Length Encoding in Java

Discussion (0)

Forem Open with the Forem app