@Test public void testLoadImage() throws Throwable { BufferedImage actual = myClassUnderTest.convert( JPG_HEX_DUMP ); myLog.debug( actual ); Assert.assertNotNull( actual ); }
@Override public BufferedImage convert( String aValue ) throws SdiException { if ( !StringUtils.hasText( aValue ) ) { myLog.debug( "Given value is null" ); return null; } byte[] binary; try { binary = Hex.decodeHex( aValue.toCharArray() ); } catch ( DecoderException t ) { throw new SdiException( "Cannot convert input value to binary array: " + aValue, t, SdiException.EXIT_CODE_PARSE_ERROR ); } ByteArrayInputStream bais = new ByteArrayInputStream( binary ); return super.convert( bais ); }
ConverterJpgFromHexDump extends ConverterImage { @Override public BufferedImage convert( String aValue ) throws SdiException { if ( !StringUtils.hasText( aValue ) ) { myLog.debug( "Given value is null" ); return null; } byte[] binary; try { binary = Hex.decodeHex( aValue.toCharArray() ); } catch ( DecoderException t ) { throw new SdiException( "Cannot convert input value to binary array: " + aValue, t, SdiException.EXIT_CODE_PARSE_ERROR ); } ByteArrayInputStream bais = new ByteArrayInputStream( binary ); return super.convert( bais ); } }
ConverterJpgFromHexDump extends ConverterImage { @Override public BufferedImage convert( String aValue ) throws SdiException { if ( !StringUtils.hasText( aValue ) ) { myLog.debug( "Given value is null" ); return null; } byte[] binary; try { binary = Hex.decodeHex( aValue.toCharArray() ); } catch ( DecoderException t ) { throw new SdiException( "Cannot convert input value to binary array: " + aValue, t, SdiException.EXIT_CODE_PARSE_ERROR ); } ByteArrayInputStream bais = new ByteArrayInputStream( binary ); return super.convert( bais ); }  }
ConverterJpgFromHexDump extends ConverterImage { @Override public BufferedImage convert( String aValue ) throws SdiException { if ( !StringUtils.hasText( aValue ) ) { myLog.debug( "Given value is null" ); return null; } byte[] binary; try { binary = Hex.decodeHex( aValue.toCharArray() ); } catch ( DecoderException t ) { throw new SdiException( "Cannot convert input value to binary array: " + aValue, t, SdiException.EXIT_CODE_PARSE_ERROR ); } ByteArrayInputStream bais = new ByteArrayInputStream( binary ); return super.convert( bais ); }  @Override FieldConverter<BufferedImage> init( Environment aEnv, String aFieldname ); @Override BufferedImage convert( String aValue ); }
ConverterJpgFromHexDump extends ConverterImage { @Override public BufferedImage convert( String aValue ) throws SdiException { if ( !StringUtils.hasText( aValue ) ) { myLog.debug( "Given value is null" ); return null; } byte[] binary; try { binary = Hex.decodeHex( aValue.toCharArray() ); } catch ( DecoderException t ) { throw new SdiException( "Cannot convert input value to binary array: " + aValue, t, SdiException.EXIT_CODE_PARSE_ERROR ); } ByteArrayInputStream bais = new ByteArrayInputStream( binary ); return super.convert( bais ); }  @Override FieldConverter<BufferedImage> init( Environment aEnv, String aFieldname ); @Override BufferedImage convert( String aValue ); static final String CONVERTER_NAME; }