return fileString;
}
-
+
/**
* Convert the given Base64 representation of an image into an {@link Image}
* object.
static public BufferedImage fromStream(InputStream in) throws IOException {
MarkableFileInputStream tmpIn = null;
File tmp = null;
- try {
- in.reset();
- } catch (IOException e) {
+
+ boolean repack = !in.markSupported();
+ if (!repack) {
+ try {
+ in.reset();
+ } catch (IOException e) {
+ repack = true;
+ }
+ }
+
+ if (repack) {
tmp = File.createTempFile(".tmp-image", ".tmp");
tmp.deleteOnExit();
IOUtils.write(in, tmp);