BSD License
For Conceal software
Copyright (c) 2014, Facebook, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that...
If you think the Android project conceal listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/*
* Copyright (c) 2014, Facebook, Inc.//fromwww.java2s.com
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/package com.facebook.crypto.streams;
import java.util.Arrays;
import org.junit.Assert;
publicclass TailBufferHelper {
/**
* Verifies that the data and the tail observed match the original data.
* @param originalData The original data that was sent to the tail buffer.
* @param readData The data read minus the tail.
* @param tail Tail obtained after processing via the tail buffer.
* @param tailLength Expected length of the tail buffer.
*/publicstaticvoid verifyDataAndTailMatch(byte[] originalData,
byte[] readData,
byte[] tail,
int tailLength) {
Assert.assertArrayEquals(
Arrays.copyOfRange(originalData, 0, originalData.length - tailLength),
readData);
Assert.assertArrayEquals(
Arrays.copyOfRange(originalData, originalData.length - tailLength, originalData.length),
tail);
}
}