mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add testcase & remove unused code
This commit is contained in:
@@ -23,8 +23,7 @@ import java.sql.Blob;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class MockBlob implements Blob {
|
||||
|
||||
private ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
private final ByteArrayOutputStream out = new ByteArrayOutputStream();
|
||||
|
||||
@Override
|
||||
public long length() throws SQLException {
|
||||
@@ -34,7 +33,8 @@ public class MockBlob implements Blob {
|
||||
@Override
|
||||
public byte[] getBytes(long pos, int length) throws SQLException {
|
||||
byte[] bytes = new byte[length];
|
||||
System.arraycopy(out.toByteArray(), (int) pos, bytes, 0, length);
|
||||
byte[] outBytes = out.toByteArray();
|
||||
System.arraycopy(outBytes, (int) (pos - 1), bytes, 0, length);
|
||||
return bytes;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user