mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -5,9 +5,10 @@ import java.awt.Graphics2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBufferByte;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
/**
|
||||
* 动态GIF动画生成器,可生成一个或多个帧的GIF。
|
||||
@@ -296,8 +297,7 @@ public class AnimatedGifEncoder {
|
||||
public boolean start(final String file) {
|
||||
boolean ok;
|
||||
try {
|
||||
//noinspection IOStreamConstructor
|
||||
out = new BufferedOutputStream(new FileOutputStream(file));
|
||||
out = new BufferedOutputStream(Files.newOutputStream(Paths.get(file)));
|
||||
ok = start(out);
|
||||
closeStream = true;
|
||||
} catch (final IOException e) {
|
||||
|
@@ -10,10 +10,11 @@ import java.awt.Rectangle;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.DataBufferInt;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
@@ -339,7 +340,7 @@ public class GifDecoder {
|
||||
final URL url = new URL(name);
|
||||
in = new BufferedInputStream(url.openStream());
|
||||
} else {
|
||||
in = new BufferedInputStream(new FileInputStream(name));
|
||||
in = new BufferedInputStream(Files.newInputStream(Paths.get(name)));
|
||||
}
|
||||
status = read(in);
|
||||
} catch (final IOException e) {
|
||||
|
Reference in New Issue
Block a user