[ExceptionToNetNumericConvention] // LUCENENET: Private API, keeping as-is private void AddShortsField(FieldInfo field, IndexOutput output, IEnumerable <long?> values) { field.PutAttribute(legacyKey, LegacyDocValuesType.FIXED_INTS_16.ToString()); CodecUtil.WriteHeader(output, Lucene40DocValuesFormat.INTS_CODEC_NAME, Lucene40DocValuesFormat.INTS_VERSION_CURRENT); output.WriteInt32(2); // size foreach (long?n in values) { output.WriteInt16((short)n.GetValueOrDefault()); } }