Examples of PaddedBucket


Examples of freenet.support.io.PaddedBucket

   
    public void checkSimple(int length, int expectedLength) throws IOException {
        ArrayBucket input = new ArrayBucket();
        BucketTools.fill(input, length);
        ArrayBucket copy = new ArrayBucket();
        PaddedBucket padded = new PaddedBucket(copy);
        BucketTools.copy(input, padded);
        assertEquals(padded.size(), input.size());
        assertEquals(copy.size(), expectedLength);
        assertTrue(BucketTools.equalBuckets(input, padded));
        InputStream aIn = input.getInputStream();
        InputStream bIn = copy.getInputStream();
        assertTrue(FileUtil.equalStreams(aIn, bIn, length));
View Full Code Here

Examples of freenet.support.io.PaddedBucket

            byte[] key = node.getPluginStoreKey(storeIdentifier);
            if(key != null) {
                // We pad then encrypt, which is wasteful, but we have no way to persist the size.
                // Unfortunately AEADCryptBucket needs to know the real termination point.
                bucket = new AEADCryptBucket(bucket, key);
                bucket = new PaddedBucket(bucket);
            }
        }
        return bucket;
    }
View Full Code Here

Examples of freenet.support.io.PaddedBucket

            byte[] key = node.getPluginStoreKey(storeIdentifier);
            if(key != null) {
                // We pad then encrypt, which is wasteful, but we have no way to persist the size.
                // Unfortunately AEADCryptBucket needs to know the real termination point.
                bucket = new AEADCryptBucket(bucket, key);
                bucket = new PaddedBucket(bucket, bucket.size());
            }
        }
        return bucket;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.