mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix bugs
This commit is contained in:
@@ -22,6 +22,9 @@ public class FastByteArrayOutputStream extends OutputStream {
|
||||
|
||||
private final FastByteBuffer buffer;
|
||||
|
||||
/**
|
||||
* 构造
|
||||
*/
|
||||
public FastByteArrayOutputStream() {
|
||||
this(1024);
|
||||
}
|
||||
|
@@ -40,10 +40,13 @@ public class FastByteBuffer {
|
||||
private final int minChunkLen;
|
||||
|
||||
public FastByteBuffer() {
|
||||
this.minChunkLen = 1024;
|
||||
this(1024);
|
||||
}
|
||||
|
||||
public FastByteBuffer(int size) {
|
||||
if(size <= 0){
|
||||
size = 1024;
|
||||
}
|
||||
this.minChunkLen = Math.abs(size);
|
||||
}
|
||||
|
||||
@@ -282,4 +285,4 @@ public class FastByteBuffer {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -102,7 +102,7 @@ public class IoUtil extends NioUtil {
|
||||
* @return 传输的byte数
|
||||
* @throws IORuntimeException IO异常
|
||||
*/
|
||||
public static long copy(Reader reader, Writer writer, int bufferSize, int count, StreamProgress streamProgress) throws IORuntimeException {
|
||||
public static long copy(Reader reader, Writer writer, int bufferSize, long count, StreamProgress streamProgress) throws IORuntimeException {
|
||||
return new ReaderWriterCopier(bufferSize, count, streamProgress).copy(reader, writer);
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ public class IoUtil extends NioUtil {
|
||||
* @throws IORuntimeException IO异常
|
||||
* @since 5.7.8
|
||||
*/
|
||||
public static long copy(InputStream in, OutputStream out, int bufferSize, int count, StreamProgress streamProgress) throws IORuntimeException {
|
||||
public static long copy(InputStream in, OutputStream out, int bufferSize, long count, StreamProgress streamProgress) throws IORuntimeException {
|
||||
return new StreamCopier(bufferSize, count, streamProgress).copy(in, out);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user