added cast to Buffer
@@ -195,7 +195,7 @@ class ReaderInputStream extends InputStream {
// - the reader throws any kind of Exception (driver throws an IOException)
// - the reader violates its interface contract (driver throws an IOException)
while (rawChars.hasRemaining()) {
- int lastPosition = rawChars.position();
+ int lastPosition = ((Buffer)rawChars).position();
int charsRead = 0;
// Try reading from the app-supplied Reader
@@ -219,7 +219,7 @@ class ReaderInputStream extends InputStream {
if (-1 == charsRead) {
// If the reader violates its interface contract then throw an exception.
- if (rawChars.position() != lastPosition)
+ if (((Buffer)rawChars).position() != lastPosition)
throw new IOException(SQLServerException.getErrString("R_streamReadReturnedInvalidValue"));
// Check that the reader has returned exactly the amount of data we expect
@@ -229,7 +229,7 @@ class ReaderInputStream extends InputStream {
}
// If there are no characters left to encode then we're done.
- if (0 == rawChars.position()) {
+ if (0 == ((Buffer)rawChars).position()) {
rawChars = null;
atEndOfStream = true;
return false;
@@ -242,7 +242,7 @@ class ReaderInputStream extends InputStream {
assert charsRead > 0;
// If the reader violates its interface contract then throw an exception.
- if (charsRead != rawChars.position() - lastPosition)
+ if (charsRead != ((Buffer)rawChars).position() - lastPosition)
throw new IOException(SQLServerException.getErrString("R_streamReadReturnedInvalidValue"));
// Check that the reader isn't trying to return more data than we expect
