Beispiel #1
0
 /**
  * Adds on offset, relative to where it will be written.
  *
  * @param off The offset to add
  */
 public void addOffset(int off) {
   prep(Constants.SIZEOF_INT, 0); // Ensure alignment is already done.
   assert off <= offset();
   off = offset() - off + Constants.SIZEOF_INT;
   putInt(off);
 }
Beispiel #2
0
 /**
  * Finish off the creation of an array and all its elements. The array must be created with {@link
  * #startVector(int, int, int)}.
  *
  * @return The offset at which the newly created array starts.
  * @see #startVector(int, int, int)
  */
 public int endVector() {
   putInt(vector_num_elems);
   return offset();
 }
Beispiel #3
0
 public void addInt(int x) {
   prep(4, 0);
   putInt(x);
 }