docs: @Override
      public int writeData(final ByteBuffer encrypted) {
          if (output.readPosition() != 0) {
              output.compact();
          }
          final int writeRemaining = (int)
                  (output.writeRemaining() > Integer.MAX_VALUE ?
                          Integer.MAX_VALUE : output.writeRemaining());
          final int toWrite = Math.min(encrypted.remaining(), writeRemaining);
          for (int i = 0; i < toWrite; i++) {
              output.writeByte(encrypted.get());
          }
          return toWrite;
      }