harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject [classlib][sql] Compatibility issue of SerialBlob.setBinaryStream(long pos)
Date Mon, 08 Jan 2007 15:35:12 GMT
Hi guys,

sorry, SerialBlob compatibility problem again. It's the last unimplemented
method of SerialBlob, setBinaryStream(long pos). The spec says "throws
SerialException - if the SerialBlob in not instantiated with a Blob object
that supports setBinaryStream()".  What should happen if the SerialBlob is
instantiated with a byte buffer? As my understanding, it should throw
SerialException, but I feel the spec is a little ambiguous, is it? I need
native speakers' help. :-) Anyway, I think throws SerialException sounds
reasonable to me if it's instantiated with a byte buffer. But RI throws
NullPointerException instead. Following test shows the problem:
public void testSetBinaryStreamJ() throws Exception {
        byte[] buf = { 1, 2, 3, 4, 5, 6, 7, 8 };
        SerialBlob serialBlob = new SerialBlob(buf);
        serialBlob.setBinaryStream(1);
    }
Shall we follow RI or throw SerialException? Thanks!

-- 
Best regards,
Andrew Zhang

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message