private void end() throws IOException { byte[] readHmac = ring.readAll(); if (readHmac.length != hmac.getLength()) throw new IOException("stream corrupted: bad hmac record size:" + readHmac.length); if (!Arrays.equals(readHmac, hmac.digest())) { throw new AuthenticationFailed("HMAC authentication failed, data corrupted"); } } }
public void dump() { new Bytes(buffer.readAll()).dump(); } }