### Question:
FlateCodec implements IByteArrayCodec { public void decode (@Nullable final byte [] aEncodedBuffer, @Nonnegative final int nOfs, @Nonnegative final int nLen, @Nonnull @WillNotClose final OutputStream aOS) { if (aEncodedBuffer == null || nLen == 0) return; if (!isZlibHead (aEncodedBuffer, nOfs, nLen)) LOGGER.warn ("ZLib header not found"); try (final InflaterInputStream aDecodeIS = new InflaterInputStream (new NonBlockingByteArrayInputStream (aEncodedBuffer, nOfs, nLen))) { if (StreamHelper.copyInputStreamToOutputStream (aDecodeIS, aOS).isFailure ()) throw new DecodeException ("Failed to flate decode!"); } catch (final IOException ex) { throw new DecodeException ("Failed to flate decode", ex); } } FlateCodec(); static boolean isZlibHead(@Nonnull final byte [] buf, @Nonnegative final int nOfs, @Nonnegative final int nLen); void decode(@Nullable final byte [] aEncodedBuffer,
                      @Nonnegative final int nOfs,
                      @Nonnegative final int nLen,
                      @Nonnull @WillNotClose final OutputStream aOS); void encode(@Nullable final byte [] aDecodedBuffer,
                      @Nonnegative final int nOfs,
                      @Nonnegative final int nLen,
                      @Nonnull @WillNotClose final OutputStream aOS);  }### Answer:
@Test public void testDecode () { final FlateCodec aCodec = new FlateCodec (); for (final String s : new String [] { "abc", "", "test blank", "hällö special chars" }) { final byte [] aDecoded = s.getBytes (CHARSET); final byte [] aEncoded = aCodec.getEncoded (aDecoded); final byte [] aDecoded2 = aCodec.getDecoded (aEncoded); assertArrayEquals (aDecoded, aDecoded2); } }