本文整理匯總了Java中javax.sql.rowset.serial.SerialBlob.setBytes方法的典型用法代碼示例。如果您正苦於以下問題:Java SerialBlob.setBytes方法的具體用法?Java SerialBlob.setBytes怎麽用?Java SerialBlob.setBytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.sql.rowset.serial.SerialBlob
的用法示例。
在下文中一共展示了SerialBlob.setBytes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: test22
import javax.sql.rowset.serial.SerialBlob; //導入方法依賴的package包/類
@Test
public void test22() throws Exception {
byte[] diff = new byte[]{7, 8, 9};
byte[] expected = new byte[]{1, 7, 8, 9, 5};
SerialBlob sb = new SerialBlob(bytes);
int written = sb.setBytes(2, diff);
assertEquals(written, diff.length);
assertTrue(
Arrays.equals(sb.getBytes(1, (int) sb.length()),
expected),
"arrays do not match ");
}
示例2: test23
import javax.sql.rowset.serial.SerialBlob; //導入方法依賴的package包/類
@Test
public void test23() throws Exception {
int bytesToWrite = 3;
byte[] diff = new byte[]{7, 8, 9, 0};
byte[] expected = new byte[]{1, 8, 9, 0, 5};
SerialBlob sb = new SerialBlob(bytes);
int written = sb.setBytes(2, diff, 1, bytesToWrite);
assertEquals(written, bytesToWrite);
assertTrue(
Arrays.equals(sb.getBytes(1, (int) sb.length()),
expected),
"arrays do not match ");
}
示例3: test08
import javax.sql.rowset.serial.SerialBlob; //導入方法依賴的package包/類
@Test(expectedExceptions = SerialException.class)
public void test08() throws Exception {
SerialBlob sb = new SerialBlob(new StubBlob());
sb.free();
sb.setBytes(1, new byte[5]);
}
示例4: test09
import javax.sql.rowset.serial.SerialBlob; //導入方法依賴的package包/類
@Test(expectedExceptions = SerialException.class)
public void test09() throws Exception {
SerialBlob sb = new SerialBlob(new StubBlob());
sb.free();
sb.setBytes(1, new byte[10], 0, 5);
}