equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
473 return new ByteArrayInputStream(buf, (int) pos - 1, (int) length); |
473 return new ByteArrayInputStream(buf, (int) pos - 1, (int) length); |
474 } |
474 } |
475 |
475 |
476 |
476 |
477 /** |
477 /** |
478 * This method frees the {@code SeriableBlob} object and releases the |
478 * This method frees the {@code SerialBlob} object and releases the |
479 * resources that it holds. The object is invalid once the {@code free} |
479 * resources that it holds. The object is invalid once the {@code free} |
480 * method is called. <p> If {@code free} is called multiple times, the |
480 * method is called. <p> If {@code free} is called multiple times, the |
481 * subsequent calls to {@code free} are treated as a no-op. </P> |
481 * subsequent calls to {@code free} are treated as a no-op. </P> |
482 * |
482 * |
483 * @throws SQLException if an error occurs releasing the Blob's resources |
483 * @throws SQLException if an error occurs releasing the Blob's resources |
576 ObjectOutputStream.PutField fields = s.putFields(); |
576 ObjectOutputStream.PutField fields = s.putFields(); |
577 fields.put("buf", buf); |
577 fields.put("buf", buf); |
578 fields.put("len", len); |
578 fields.put("len", len); |
579 fields.put("origLen", origLen); |
579 fields.put("origLen", origLen); |
580 // Note: this check to see if it is an instance of Serializable |
580 // Note: this check to see if it is an instance of Serializable |
581 // is for backwards compatibiity |
581 // is for backwards compatibility |
582 fields.put("blob", blob instanceof Serializable ? blob : null); |
582 fields.put("blob", blob instanceof Serializable ? blob : null); |
583 s.writeFields(); |
583 s.writeFields(); |
584 } |
584 } |
585 |
585 |
586 /** |
586 /** |