add testcase & remove unused code

This commit is contained in:
wenshao
2013-06-16 08:51:51 +08:00
parent 2aabdaea4b
commit da433839ee
98 changed files with 1424 additions and 1459 deletions
@@ -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;
}