Skip to content

Commit bbf3d33

Browse files
committed
Remove storing length in blob input stream again
1 parent 72ebf05 commit bbf3d33

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/main/org/firebirdsql/jdbc/FBBlobInputStream.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@
3636
*/
3737
public final class FBBlobInputStream extends InputStream implements FirebirdBlob.BlobInputStream {
3838

39-
private final long LENGTH_UNKNOWN = -1;
40-
4139
private byte[] buffer = ByteArrayHelper.emptyByteArray();
4240
private FbBlob blobHandle;
4341
private int pos;
4442
private int lim;
45-
private long length = LENGTH_UNKNOWN;
4643
private boolean closed;
4744

4845
private final FBBlob owner;
@@ -83,10 +80,7 @@ public void seek(int position, FbBlob.SeekMode seekMode) throws IOException {
8380
public long length() throws IOException {
8481
try (LockCloseable ignored = owner.withLock()) {
8582
checkClosed();
86-
if (length != LENGTH_UNKNOWN) {
87-
return length;
88-
}
89-
return length = blobHandle.length();
83+
return blobHandle.length();
9084
} catch (SQLException e) {
9185
throw new IOException(e);
9286
}

0 commit comments

Comments
 (0)