@Override public void write(int b) throws IOException { index += blockCipher.processByte((byte) b, buffer, index); if (index == buffer.length) { flush(); } else if (index > buffer.length) { throw new IllegalStateException( "Cipher buffer overflow, " + "buffer size must not exceed block size of 32 bytes " + "but was " + index); } }