Created
April 6, 2016 11:19
-
-
Save ivanursul/f46713f6934301bf8e17b058eea3f5bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static ImageStreamWrapper getStreamWrapper(Supplier<FormDataBodyPart> supplier) { | |
return Optional.ofNullable(supplier.get()) | |
.map(field -> { | |
InputStream is = field.getValueAs(InputStream.class); | |
long contentLength = getContentLength(field); | |
return new ImageStreamWrapper(is, contentLength); | |
}).orElse(null); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment