jdk/src/share/classes/javax/sql/rowset/serial/SerialBlob.java
author lancea
Thu, 09 Dec 2010 13:01:14 -0500
changeset 7544 85a0e84bb9a0
parent 5506 202f599c92aa
child 10323 48d695d1e966
permissions -rw-r--r--
6659234: Incorrect check in SerialBlob.getBytes Reviewed-by: darcy
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
7544
85a0e84bb9a0 6659234: Incorrect check in SerialBlob.getBytes
lancea
parents: 5506
diff changeset
     2
 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.sql.rowset.serial;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.lang.reflect.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * A serialized mapping in the Java programming language of an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * <code>BLOB</code> value.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * The <code>SerialBlob</code> class provides a constructor for creating
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * an instance from a <code>Blob</code> object.  Note that the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * <code>Blob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * object should have brought the SQL <code>BLOB</code> value's data over
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * to the client before a <code>SerialBlob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * is constructed from it.  The data of an SQL <code>BLOB</code> value can
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * be materialized on the client as an array of bytes (using the method
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * <code>Blob.getBytes</code>) or as a stream of uninterpreted bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * (using the method <code>Blob.getBinaryStream</code>).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <code>SerialBlob</code> methods make it possible to make a copy of a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * <code>SerialBlob</code> object as an array of bytes or as a stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * They also make it possible to locate a given pattern of bytes or a
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * <code>Blob</code> object within a <code>SerialBlob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * and to update or truncate a <code>Blob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * @author Jonathan Bruce
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
public class SerialBlob implements Blob, Serializable, Cloneable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * A serialized array of uninterpreted bytes representing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * value of this <code>SerialBlob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    private byte buf[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     * The internal representation of the <code>Blob</code> object on which this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * <code>SerialBlob</code> object is based.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    private Blob blob;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * The number of bytes in this <code>SerialBlob</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * array of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    private long len;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * The orginal number of bytes in this <code>SerialBlob</code> object's
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * array of bytes when it was first established.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    private long origLen;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * Constructs a <code>SerialBlob</code> object that is a serialized version of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * the given <code>byte</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * The new <code>SerialBlob</code> object is initialized with the data from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     * <code>byte</code> array, thus allowing disconnected <code>RowSet</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     * objects to establish serialized <code>Blob</code> objects without
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * touching the data source.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * @param b the <code>byte</code> array containing the data for the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     *        <code>Blob</code> object to be serialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * @throws SerialException if an error occurs during serialization
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     * @throws SQLException if a SQL errors occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    public SerialBlob(byte[] b) throws SerialException, SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        len = b.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        buf = new byte[(int)len];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        for(int i = 0; i < len; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
           buf[i] = b[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        origLen = len;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * Constructs a <code>SerialBlob</code> object that is a serialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * version of the given <code>Blob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * The new <code>SerialBlob</code> object is initialized with the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * data from the <code>Blob</code> object; therefore, the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * <code>Blob</code> object should have previously brought the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * SQL <code>BLOB</code> value's data over to the client from
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     * the database. Otherwise, the new <code>SerialBlob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
     * will contain no data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
     * @param blob the <code>Blob</code> object from which this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
     *     <code>SerialBlob</code> object is to be constructed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
     *     cannot be null.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
     * @throws SerialException if an error occurs during serialization
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
     * @throws SQLException if the <code>Blob</code> passed to this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     *     to this constructor is a <code>null</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * @see java.sql.Blob
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    public SerialBlob (Blob blob) throws SerialException, SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        if (blob == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            throw new SQLException("Cannot instantiate a SerialBlob " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                 "object with a null Blob object");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        len = blob.length();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        buf = blob.getBytes(1, (int)len );
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        this.blob = blob;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
         //if ( len < 10240000)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
         // len = 10240000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        origLen = len;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * Copies the specified number of bytes, starting at the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     * position, from this <code>SerialBlob</code> object to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
     * another array of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
     * Note that if the given number of bytes to be copied is larger than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * the length of this <code>SerialBlob</code> object's array of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     * bytes, the given number will be shortened to the array's length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * @param pos the ordinal position of the first byte in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     *            <code>SerialBlob</code> object to be copied;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     *            numbering starts at <code>1</code>; must not be less
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *            than <code>1</code> and must be less than or equal
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     *            to the length of this <code>SerialBlob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * @param length the number of bytes to be copied
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * @return an array of bytes that is a copy of a region of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *         <code>SerialBlob</code> object, starting at the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     *         position and containing the given number of consecutive bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     * @throws SerialException if the given starting position is out of bounds
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    public byte[] getBytes(long pos, int length) throws SerialException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        if (length > len) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            length = (int)len;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
7544
85a0e84bb9a0 6659234: Incorrect check in SerialBlob.getBytes
lancea
parents: 5506
diff changeset
   169
        if (pos < 1 || len - pos < 0 ) {
85a0e84bb9a0 6659234: Incorrect check in SerialBlob.getBytes
lancea
parents: 5506
diff changeset
   170
            throw new SerialException("Invalid arguments: position cannot be "
85a0e84bb9a0 6659234: Incorrect check in SerialBlob.getBytes
lancea
parents: 5506
diff changeset
   171
                    + "less than 1 or greater than the length of the SerialBlob");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        pos--; // correct pos to array index
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        byte[] b = new byte[length];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        for (int i = 0; i < length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
            b[i] = this.buf[(int)pos];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
            pos++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        return b;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * Retrieves the number of bytes in this <code>SerialBlob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     * object's array of bytes.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * @return a <code>long</code> indicating the length in bytes of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *         <code>SerialBlob</code> object's array of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * @throws SerialException if an error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    public long length() throws SerialException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        return len;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
     * Returns this <code>SerialBlob</code> object as an input stream.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Unlike the related method, <code>setBinaryStream</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     * a stream is produced regardless of whether the <code>SerialBlob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * was created with a <code>Blob</code> object or a <code>byte</code> array.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     * @return a <code>java.io.InputStream</code> object that contains
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     *         this <code>SerialBlob</code> object's array of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * @throws SerialException if an error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * @see #setBinaryStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    public java.io.InputStream getBinaryStream() throws SerialException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
         InputStream stream = new ByteArrayInputStream(buf);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
         return (java.io.InputStream)stream;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * Returns the position in this <code>SerialBlob</code> object where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * the given pattern of bytes begins, starting the search at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * specified position.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * @param pattern the pattern of bytes for which to search
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     * @param start the position of the byte in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     *              <code>SerialBlob</code> object from which to begin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     *              the search; the first position is <code>1</code>;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     *              must not be less than <code>1</code> nor greater than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     *              the length of this <code>SerialBlob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * @return the position in this <code>SerialBlob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     *         where the given pattern begins, starting at the specified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     *         position; <code>-1</code> if the pattern is not found
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     *         or the given starting position is out of bounds; position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
     *         numbering for the return value starts at <code>1</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
     * @throws SerialException if an error occurs when serializing the blob
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * @throws SQLException if there is an error accessing the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     *         value from the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    public long position(byte[] pattern, long start)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                throws SerialException, SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        if (start < 1 || start > len) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
            return -1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        int pos = (int)start-1; // internally Blobs are stored as arrays.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        long patlen = pattern.length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        while (pos < len) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
            if (pattern[i] == buf[pos]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
                if (i + 1 == patlen) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                    return (pos + 1) - (patlen - 1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
                i++; pos++; // increment pos, and i
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
            } else if (pattern[i] != buf[pos]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
                pos++; // increment pos only
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
        return -1; // not found
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * Returns the position in this <code>SerialBlob</code> object where
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * the given <code>Blob</code> object begins, starting the search at the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * specified position.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
     * @param pattern the <code>Blob</code> object for which to search;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * @param start the position of the byte in this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     *              <code>SerialBlob</code> object from which to begin
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     *              the search; the first position is <code>1</code>;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     *              must not be less than <code>1</code> nor greater than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     *              the length of this <code>SerialBlob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * @return the position in this <code>SerialBlob</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     *         where the given <code>Blob</code> object begins, starting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     *         at the specified position; <code>-1</code> if the pattern is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     *         not found or the given starting position is out of bounds;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     *         position numbering for the return value starts at <code>1</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     * @throws SerialException if an error occurs when serializing the blob
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * @throws SQLException if there is an error accessing the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *         value from the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    public long position(Blob pattern, long start)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
       throws SerialException, SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
        return position(pattern.getBytes(1, (int)(pattern.length())), start);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
     * Writes the given array of bytes to the <code>BLOB</code> value that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * this <code>Blob</code> object represents, starting at position
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     * <code>pos</code>, and returns the number of bytes written.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
     * @param pos the position in the SQL <code>BLOB</code> value at which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
     *     to start writing. The first position is <code>1</code>;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     *     must not be less than <code>1</code> nor greater than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     *     the length of this <code>SerialBlob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     * @param bytes the array of bytes to be written to the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     *        value that this <code>Blob</code> object represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     * @return the number of bytes written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
     * @throws SerialException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
     *     <code>BLOB</code> value; or if an invalid position is set; if an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     *     invalid offset value is set
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
     * @throws SQLException if there is an error accessing the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     *         value from the database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
     * @see #getBytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    public int setBytes(long pos, byte[] bytes)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
        throws SerialException, SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
        return (setBytes(pos, bytes, 0, bytes.length));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * Writes all or part of the given <code>byte</code> array to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * <code>BLOB</code> value that this <code>Blob</code> object represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
     * and returns the number of bytes written.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * Writing starts at position <code>pos</code> in the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
     * value; <i>len</i> bytes from the given byte array are written.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * @param pos the position in the <code>BLOB</code> object at which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
     *     to start writing. The first position is <code>1</code>;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     *     must not be less than <code>1</code> nor greater than
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
     *     the length of this <code>SerialBlob</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * @param bytes the array of bytes to be written to the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
     *     value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * @param offset the offset in the <code>byte</code> array at which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     *     to start reading the bytes. The first offset position is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     *     <code>0</code>; must not be less than <code>0</code> nor greater
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     *     than the length of the <code>byte</code> array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * @param length the number of bytes to be written to the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
     *     <code>BLOB</code> value from the array of bytes <i>bytes</i>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * @return the number of bytes written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     * @throws SerialException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     *     <code>BLOB</code> value; if an invalid position is set; if an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     *     invalid offset value is set; if number of bytes to be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
     *     is greater than the <code>SerialBlob</code> length; or the combined
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     *     values of the length and offset is greater than the Blob buffer
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     * @throws SQLException if there is an error accessing the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     *         value from the database.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * @see #getBytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
    public int setBytes(long pos, byte[] bytes, int offset, int length)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
        throws SerialException, SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
        if (offset < 0 || offset > bytes.length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
            throw new SerialException("Invalid offset in byte array set");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        if (pos < 1 || pos > this.length()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
            throw new SerialException("Invalid position in BLOB object set");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
        if ((long)(length) > origLen) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
            throw new SerialException("Buffer is not sufficient to hold the value");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
        if ((length + offset) > bytes.length) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
            throw new SerialException("Invalid OffSet. Cannot have combined offset " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
                "and length that is greater that the Blob buffer");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        int i = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        pos--; // correct to array indexing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        while ( i < length || (offset + i +1) < (bytes.length-offset) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
            this.buf[(int)pos + i] = bytes[offset + i ];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
            i++;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
        return i;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     * Retrieves a stream that can be used to write to the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * value that this <code>Blob</code> object represents.  The stream begins
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * at position <code>pos</code>. This method forwards the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     * <code>setBinaryStream()</code> call to the underlying <code>Blob</code> in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
     * the event that this <code>SerialBlob</code> object is instantiated with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
     * <code>Blob</code>. If this <code>SerialBlob</code> is instantiated with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * a <code>byte</code> array, a <code>SerialException</code> is thrown.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     * @param pos the position in the <code>BLOB</code> value at which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
     *        to start writing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
     * @return a <code>java.io.OutputStream</code> object to which data can
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     *         be written
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
     * @throws SQLException if there is an error accessing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     *            <code>BLOB</code> value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     * @throws SerialException if the SerialBlob in not instantiated with a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
     *     <code>Blob</code> object that supports <code>setBinaryStream()</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     * @see #getBinaryStream
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
    public java.io.OutputStream setBinaryStream(long pos)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
        throws SerialException, SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        if (this.blob.setBinaryStream(pos) != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
            return this.blob.setBinaryStream(pos);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
            throw new SerialException("Unsupported operation. SerialBlob cannot " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
                "return a writable binary stream, unless instantiated with a Blob object " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
                "that provides a setBinaryStream() implementation");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * Truncates the <code>BLOB</code> value that this <code>Blob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * object represents to be <code>len</code> bytes in length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * @param length the length, in bytes, to which the <code>BLOB</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     *        value that this <code>Blob</code> object represents should be
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     *        truncated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * @throws SerialException if there is an error accessing the Blob value;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     *     or the length to truncate is greater that the SerialBlob length
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    public void truncate(long length) throws SerialException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
         if (length > len) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
            throw new SerialException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
               ("Length more than what can be truncated");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
         } else if((int)length == 0) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
              buf = new byte[0];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
              len = length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
         } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
              len = length;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
              buf = this.getBytes(1, (int)len);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
         }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * Returns an <code>InputStream</code> object that contains a partial <code>Blob</code> value,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * starting  with the byte specified by pos, which is length bytes in length.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * @param pos the offset to the first byte of the partial value to be retrieved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     *  The first byte in the <code>Blob</code> is at position 1
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * @param length the length in bytes of the partial value to be retrieved
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * @return <code>InputStream</code> through which the partial <code>Blob</code> value can be read.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     * @throws SQLException if pos is less than 1 or if pos is greater than the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * in the <code>Blob</code> or if pos + length is greater than the number of bytes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     * in the <code>Blob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
    public InputStream getBinaryStream(long pos,long length) throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
        throw new java.lang.UnsupportedOperationException("Not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * This method frees the <code>Blob</code> object and releases the resources that it holds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * <code>Blob</code> object. The object is invalid once the <code>free</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     * method is called. If <code>free</code> is called multiple times, the subsequent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
     * calls to <code>free</code> are treated as a no-op.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
     * @throws SQLException if an error occurs releasing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * the Blob's resources
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    public void free() throws SQLException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
        throw new java.lang.UnsupportedOperationException("Not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
         * The identifier that assists in the serialization of this <code>SerialBlob</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
    static final long serialVersionUID = -8144641928112860441L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
}