Java Code Examples for javax.sql.rowset.serial.SerialBlob#setBytes()

The following examples show how to use javax.sql.rowset.serial.SerialBlob#setBytes() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SerialBlobTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 2
Source File: SerialBlobTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 3
Source File: SerialBlobTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 4
Source File: SerialBlobTests.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 5
Source File: SerialBlobTests.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 6
Source File: SerialBlobTests.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 7
Source File: SerialBlobTests.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 8
Source File: SerialBlobTests.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 9
Source File: SerialBlobTests.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 10
Source File: SerialBlobTests.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 11
Source File: SerialBlobTests.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 12
Source File: SerialBlobTests.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@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 ");
}
 
Example 13
Source File: SerialBlobTests.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@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);
}
 
Example 14
Source File: SerialBlobTests.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = SerialException.class)
public void test08() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    sb.free();
    sb.setBytes(1, new byte[5]);
}
 
Example 15
Source File: SerialBlobTests.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@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);
}
 
Example 16
Source File: SerialBlobTests.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@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);
}
 
Example 17
Source File: SerialBlobTests.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@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);
}
 
Example 18
Source File: SerialBlobTests.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@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);
}
 
Example 19
Source File: SerialBlobTests.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = SerialException.class)
public void test08() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    sb.free();
    sb.setBytes(1, new byte[5]);
}
 
Example 20
Source File: SerialBlobTests.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Test(expectedExceptions = SerialException.class)
public void test08() throws Exception {
    SerialBlob sb = new SerialBlob(new StubBlob());
    sb.free();
    sb.setBytes(1, new byte[5]);
}