diff --git a/.classpath b/.classpath index f31ff507c..16179d3a8 100644 --- a/.classpath +++ b/.classpath @@ -14,7 +14,6 @@ - @@ -22,5 +21,6 @@ + diff --git a/components/net/sf/briar/db/JdbcDatabase.java b/components/net/sf/briar/db/JdbcDatabase.java index 6d7bed07f..64c3ba450 100644 --- a/components/net/sf/briar/db/JdbcDatabase.java +++ b/components/net/sf/briar/db/JdbcDatabase.java @@ -1,9 +1,7 @@ package net.sf.briar.db; -import java.io.EOFException; import java.io.File; import java.io.IOException; -import java.io.InputStream; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; @@ -1083,29 +1081,8 @@ abstract class JdbcDatabase implements Database { if(!rs.next()) throw new DbStateException(); int bodyStart = rs.getInt(1); int bodyLength = rs.getInt(2); - InputStream in = rs.getBlob(3).getBinaryStream(); - // FIXME: We have to read and discard the header because - // InputStream.skip() is broken for blobs - find out why - byte[] head = new byte[bodyStart]; - byte[] body = new byte[bodyLength]; - try { - int offset = 0; - while(offset < head.length) { - int read = in.read(head, offset, head.length - offset); - if(read == -1) throw new SQLException(new EOFException()); - offset += read; - } - offset = 0; - while(offset < body.length) { - int read = in.read(body, offset, body.length - offset); - if(read == -1) throw new SQLException(new EOFException()); - offset += read; - } - in.close(); - } catch(IOException e) { - if(LOG.isLoggable(Level.WARNING)) LOG.warning(e.getMessage()); - throw new SQLException(e); - } + // Bytes are indexed from 1 rather than 0 + byte[] body = rs.getBlob(3).getBytes(bodyStart + 1, bodyLength); if(rs.next()) throw new DbStateException(); rs.close(); ps.close(); diff --git a/lib/h2small-1.3.157.jar b/lib/h2small-1.3.157.jar deleted file mode 100644 index 3f70fcf5a..000000000 Binary files a/lib/h2small-1.3.157.jar and /dev/null differ diff --git a/lib/h2small-snapshot-2011-10-25.jar b/lib/h2small-snapshot-2011-10-25.jar new file mode 100644 index 000000000..85821fc58 Binary files /dev/null and b/lib/h2small-snapshot-2011-10-25.jar differ