@Override public InputStream primitiveValue(final EdmPrimitiveType type, final Object value, final PrimitiveValueSerializerOptions options) throws SerializerException { try { final String result = type.valueToString(value, options.isNullable(), options.getMaxLength(), options.getPrecision(), options.getScale(), options.isUnicode()); return new ByteArrayInputStream(result.getBytes("UTF-8")); } catch (final EdmPrimitiveTypeException e) { throw new SerializerException("Error in primitive-value formatting.", e, SerializerException.MessageKeys.WRONG_PRIMITIVE_VALUE, type.getFullQualifiedName().getFullQualifiedNameAsString(), value.toString()); } catch (final UnsupportedEncodingException e) { throw new SerializerException("Encoding exception.", e, SerializerException.MessageKeys.IO_EXCEPTION); } }
@Override public InputStream primitiveValue(final EdmPrimitiveType type, final Object value, final PrimitiveValueSerializerOptions options) throws SerializerException { try { final String result = type.valueToString(value, options.isNullable(), options.getMaxLength(), options.getPrecision(), options.getScale(), options.isUnicode()); return new ByteArrayInputStream(result.getBytes("UTF-8")); } catch (final EdmPrimitiveTypeException e) { throw new SerializerException("Error in primitive-value formatting.", e, SerializerException.MessageKeys.WRONG_PRIMITIVE_VALUE, type.getFullQualifiedName().getFullQualifiedNameAsString(), value.toString()); } catch (final UnsupportedEncodingException e) { throw new SerializerException("Encoding exception.", e, SerializerException.MessageKeys.IO_EXCEPTION); } }