/** * Reads from {@link this.tmpBytes} an object at {@param offset}, will reuse {@param value} if * possible, to reduce object creation. * * @param offset the offset to read the data from * @param value the object to reuse ( if possible ), if null a new object will be created an * object and no reuse will occur. */ @SuppressWarnings("unchecked") V readObjectUsing(V value, final long offset) { if (value instanceof Byteable) { ((Byteable) value).bytes(bytes, offset); return value; } if (generatedValueType) { if (value == null) value = DataValueClasses.newInstance(vClass); ((BytesMarshallable) value).readMarshallable(tmpBytes); return value; } return tmpBytes.readInstance(vClass, value); }