Code example for ByteArrayInputStream

0
    public byte[] asBytes() { 
        return fileItem.get(); 
    } 
 
    public InputStream asStream() { 
        return new ByteArrayInputStream(fileItem.get()); 
    } 
 
    public String getContentType() { 
        return fileItem.getContentType(); 
    } 
 
    public String getFileName() { 
        return fileItem.getName(); 
    } 
 
    public String getFieldName() { 
        return fileItem.getFieldName(); 
    }