/** * INTERNAL: Copies the occurrence value and datatype from the * source topic to the target topic. * * @since 4.0 */ public static void copyOccurrenceData(OccurrenceIF target, OccurrenceIF source) { if (source.getLength() > DataTypes.SIZE_THRESHOLD) { Reader r = source.getReader(); try { target.setReader(r, source.getLength(), source.getDataType()); } catch (Exception e) { try { r.close(); } catch (Exception e2) { } throw new OntopiaRuntimeException(e); } } else { target.setValue(source.getValue(), source.getDataType()); } }
ri = new FileReader(filein); ro = new FileReader(fileout); long outlen = occurrence.getLength(); try { assertTrue("Occurrence value put in is not the same as the one we get out.", IOUtils.contentEquals(ro, ri));