@Override @SuppressWarnings("deprecation") public void reset() { this.itemCode.setNull(); this.itemName.setNull(); this.departmentCode.setNull(); this.departmentName.setNull(); this.categoryCode.setNull(); this.categoryName.setNull(); this.unitSellingPrice.setNull(); this.registeredDate.setNull(); this.beginDate.setNull(); this.endDate.setNull(); } @Override
@SuppressWarnings("deprecation") @Override public void readFields(DataInput in) throws IOException { if (in.readBoolean() == false) { setNull(); } else { nullValue = false; entity.readFields(in); } }
@Override public void clear(StringOption property) { property.setNull(); }
@Override public void absent(StringOption property) { property.setNull(); }
@SuppressWarnings("deprecation") @Override public void fill(StringOption option) throws CsvFormatException, IOException { seekBuffer(); if (lineBuffer.hasRemaining()) { String value = lineBuffer.toString(); option.modify(value); } else { option.setNull(); } }
@Override @SuppressWarnings("deprecation") public void reset() { this.categoryCode.setNull(); this.amountTotal.setNull(); this.sellingPriceTotal.setNull(); } @Override
@SuppressWarnings("deprecation") @Override public int restore(byte[] bytes, int offset, int limit) throws IOException { if (limit - offset == 0) { throw new IOException(MessageFormat.format( "Cannot restore a String field ({0})", "invalid length")); } if (bytes[offset] == 0) { setNull(); return 1; } int size = WritableUtils.decodeVIntSize(bytes[offset + 1]); if (limit - offset < size + 1) { throw new IOException(MessageFormat.format( "Cannot restore a String field ({0})", "invalid length")); } int length = (int) ByteArrayUtil.readVLong(bytes, offset + 1); if (limit - offset >= size + 1 + length) { nullValue = false; entity.set(bytes, offset + size + 1, length); return size + 1 + length; } else { throw new IOException(MessageFormat.format( "Cannot restore a String field ({0})", "invalid length")); } }
int c = reader.read(); if (c == ESCAPE_NULL_COLUMN) { option.setNull(); int next = reader.read(); if (isSeparator(next) == false) {
@SuppressWarnings("deprecation") private byte[] dump(String[] lines) throws IOException { LineConfiguration conf = new LineConfiguration().withCharset(charset); ByteArrayOutputStream bytes = new ByteArrayOutputStream(); try (ModelOutput<StringOption> output = LineOutput.newInstance(bytes, "testing", conf)) { StringOption buf = new StringOption(); for (String line : lines) { if (line == null) { buf.setNull(); } else { buf.modify(line); } output.write(buf); } } return bytes.toByteArray(); }
emitter.endRecord(); value.setNull(); emitter.emit(value); value.modify("\n\t\\");