From 17cac5d7afae1fcc0461f725fdb5a074c1f71ea1 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Sun, 1 Oct 2006 02:49:30 +0000 Subject: Support proper initial position. --- src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java | 7 ++++--- src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/repo') diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java index 44612bd..d84d033 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCBlob.java @@ -63,7 +63,7 @@ class JDBCBlob extends AbstractBlob implements JDBCLob { if (pos == 0) { return getInternalBlobForFetch().getBinaryStream(); } - return new Input(getInternalBlobForFetch(), DEFAULT_BUFFER); + return new Input(getInternalBlobForFetch(), DEFAULT_BUFFER, pos); } catch (SQLException e) { throw mRepo.toFetchException(e); } @@ -77,7 +77,7 @@ class JDBCBlob extends AbstractBlob implements JDBCLob { if (bufferSize <= 0) { bufferSize = DEFAULT_BUFFER; } - return new Input(getInternalBlobForFetch(), bufferSize); + return new Input(getInternalBlobForFetch(), bufferSize, pos); } catch (SQLException e) { throw mRepo.toFetchException(e); } @@ -162,9 +162,10 @@ class JDBCBlob extends AbstractBlob implements JDBCLob { private byte[] mBuffer; private int mBufferPos; - Input(java.sql.Blob blob, int bufferSize) { + Input(java.sql.Blob blob, int bufferSize, long pos) { mBlob = blob; mBufferSize = bufferSize; + mPos = pos; } public int read() throws IOException { diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java index 95c8966..70ce7f9 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/JDBCClob.java @@ -63,7 +63,7 @@ class JDBCClob extends AbstractClob implements JDBCLob { if (pos == 0) { return getInternalClobForFetch().getCharacterStream(); } - return new Input(getInternalClobForFetch(), DEFAULT_BUFFER); + return new Input(getInternalClobForFetch(), DEFAULT_BUFFER, pos); } catch (SQLException e) { throw mRepo.toFetchException(e); } @@ -77,7 +77,7 @@ class JDBCClob extends AbstractClob implements JDBCLob { if (bufferSize <= 0) { bufferSize = DEFAULT_BUFFER; } - return new Input(getInternalClobForFetch(), bufferSize); + return new Input(getInternalClobForFetch(), bufferSize, pos); } catch (SQLException e) { throw mRepo.toFetchException(e); } @@ -162,9 +162,10 @@ class JDBCClob extends AbstractClob implements JDBCLob { private String mBuffer; private int mBufferPos; - Input(java.sql.Clob clob, int bufferSize) { + Input(java.sql.Clob clob, int bufferSize, long pos) { mClob = clob; mBufferSize = bufferSize; + mPos = pos; } public int read() throws IOException { -- cgit v1.2.3