1 11 package org.eclipse.core.internal.indexing; 12 13 class Pointer { 14 protected Buffer buffer; protected int offset; 17 20 public Pointer(Buffer buffer, int offset) { 21 this.buffer = buffer; 22 this.offset = offset; 23 } 24 25 public Pointer dec(int n) { 26 offset -= n; 27 return this; 28 } 29 30 public FieldArray getArray(int length, int stride, int count) { 31 return new FieldArray(buffer, offset, length, stride, count); 32 } 33 34 public Field getField(int offset, int length) { 35 return new Field(buffer, this.offset + offset, length); 36 } 37 38 public Pointer inc(int n) { 39 offset += n; 40 return this; 41 } 42 43 public Pointer put(byte[] bytes) { 44 buffer.put(offset, bytes); 45 return this; 46 } 47 } 48 | Popular Tags |