Class ByteArrayConverter

java.lang.Object
jodd.typeconverter.impl.ByteArrayConverter
All Implemented Interfaces:
TypeConverter<byte[]>

public class ByteArrayConverter extends Object implements TypeConverter<byte[]>
Converts given object to byte[].
  • Field Details

  • Constructor Details

  • Method Details

    • convert

      public byte[] convert(Object value)
      Description copied from interface: TypeConverter
      Converts object received as parameter into object of another class. For example, an Integer converter tries to convert given objects into target Integer object. Converters should try all reasonable ways of conversion into target object, depending on target type.
      Specified by:
      convert in interface TypeConverter<byte[]>
      Parameters:
      value - object to convert from
      Returns:
      resulting object converted to target type
    • convertType

      protected byte convertType(Object value)
      Converts type using type converter manager.
    • convertToSingleElementArray

      protected byte[] convertToSingleElementArray(Object value)
      Creates an array with single element.
    • convertValueToArray

      protected byte[] convertValueToArray(Object value)
      Converts non-array value to array. Detects various types and collections, iterates them to make conversion and to create target array.
    • convertArrayToArray

      protected byte[] convertArrayToArray(Object value)
      Converts array value to array.
    • convertPrimitiveArrayToArray

      protected byte[] convertPrimitiveArrayToArray(Object value, Class primitiveComponentType)
      Converts primitive array to target array.