Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.fasterxml.jackson.module.jaxb.deser;
 
 

Author(s):
Ryan Heaton
    public DataHandlerJsonDeserializer() { super(DataHandler.class); }
    @Override
        throws IOExceptionJsonProcessingException
    {
        final byte[] value = jp.getBinaryValue();
        return new DataHandler(new DataSource() {
            public InputStream getInputStream() throws IOException
            {
                return new ByteArrayInputStream(value);
            }
            public OutputStream getOutputStream() throws IOException
            {
                throw new IOException();
            }
            public String getContentType()
            {
                return "application/octet-stream";
            }
           public String getName()
            {
                return "json-binary-data";
            }
        });
    }
New to GrepCode? Check out our FAQ X