pdf/src/main/java/se/idsec/signservice/integration/document/pdf/visiblesig/VisibleSignatureImageSerializer.java
private static byte[] decompress(final byte[] data) throws IOException {
    try {
      final Inflater inflater = new Inflater();
      inflater.setInput(data);
      final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(data.length);
      final byte[] buffer = new byte[1024];
      while (!inflater.finished()) {
        final int count = inflater.inflate(buffer);
        outputStream.write(buffer, 0, count);
      }
      outputStream.close();
      return outputStream.toByteArray();
    }
    catch (DataFormatException e) {
      throw new IOException(e);
    }
  }
/**
   * Decompression of data.
   *
   * @param data
   *          data to be inflated
   * @return inflated data
   * @throws IOException
   *           on invalid input
   */
Decompression of data.
@param data
data to be inflated
@return inflated data
@throws IOException
on invalid input
Decompression of data . @param data data to be inflated @return inflated data @throws IOException on invalid input
private static byte[] decompress(final byte[] data) throws IOException {
    try {
      final Inflater inflater = new Inflater();
      inflater.setInput(data);
      final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(data.length);
      final byte[] buffer = new byte[1024];
      while (!inflater.finished()) {
        final int count = inflater.inflate(buffer);
        outputStream.write(buffer, 0, count);
      }
      outputStream.close();
      return outputStream.toByteArray();
    }
    catch (DataFormatException e) {
      throw new IOException(e);
    }
  }
private static byte [ ] decompress ( final byte [ ] data ) throws IOException { try { final Inflater inflater = new Inflater ( ) ; inflater . setInput ( data ) ; final ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( data . length ) ; final byte [ ] buffer = new byte [ 1024 ] ; while ( ! inflater . finished ( ) ) { final int count = inflater . inflate ( buffer ) ; outputStream . write ( buffer , 0 , count ) ; } outputStream . close ( ) ; return outputStream . toByteArray ( ) ; } catch ( DataFormatException e ) { throw new IOException ( e ) ; } }
Decompression of data.
Decompression of data .