Block.java 731 B

123456789101112131415161718192021222324252627
  1. // Copyright (C) 2014 by Xiao Shaun Wang <wangxiao@cs.umd.edu>
  2. package com.oblivm.backend.oram;
  3. import java.util.Arrays;
  4. public class Block<T> {
  5. public T[] iden;
  6. public T[] pos;
  7. public T[] data;
  8. public T isDummy;
  9. public Block(T[] iden, T[] pos, T[] data, T isDummy) {
  10. this.iden = iden;
  11. this.pos = pos;
  12. this.data = data;
  13. this.isDummy = isDummy;
  14. }
  15. public Block(T[] Tarray, int lengthOfIden, int lengthOfPos, int lengthOfData) {
  16. iden = Arrays.copyOfRange(Tarray, 0, lengthOfIden);
  17. pos = Arrays.copyOfRange(Tarray, lengthOfIden, lengthOfIden + lengthOfPos);
  18. data = Arrays.copyOfRange(Tarray, lengthOfIden + lengthOfPos, lengthOfIden + lengthOfPos + lengthOfData);
  19. isDummy = Tarray[Tarray.length - 1];
  20. }
  21. }