~ubuntu-branches/ubuntu/gutsy/libpgjava/gutsy

« back to all changes in this revision

Viewing changes to src/interfaces/jdbc/org/postgresql/util/PGbytea.java

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Vandyck
  • Date: 2005-04-21 14:25:11 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050421142511-wibh5vc31fkrorx7
Tags: 7.4.7-3
Built with sources...

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-------------------------------------------------------------------------
 
2
 *
 
3
 * PGbytea.java
 
4
 *     Converts to and from the postgresql bytea datatype used by the backend.
 
5
 *
 
6
 * Copyright (c) 2003, PostgreSQL Global Development Group
 
7
 *
 
8
 * IDENTIFICATION
 
9
 *        $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/util/Attic/PGbytea.java,v 1.8 2003/05/29 04:48:33 barry Exp $
 
10
 *
 
11
 *-------------------------------------------------------------------------
 
12
 */
1
13
package org.postgresql.util;
2
14
 
3
15
import java.sql.*;
4
16
 
5
 
/*
6
 
 * Converts to and from the postgresql bytea datatype used by the backend.
7
 
 *
8
 
 * $Id: PGbytea.java,v 1.4 2002/01/05 22:26:23 barry Exp $
9
 
 */
10
 
 
11
17
public class PGbytea
12
18
{
13
19
 
19
25
        {
20
26
                if (s == null)
21
27
                        return null;
22
 
                int slength = s.length;
 
28
                int slength = s.length;
23
29
                byte[] buf = new byte[slength];
24
30
                int bufpos = 0;
25
31
                int thebyte;
62
68
        {
63
69
                if (p_buf == null)
64
70
                        return null;
65
 
                StringBuffer l_strbuf = new StringBuffer();
 
71
                StringBuffer l_strbuf = new StringBuffer(2 * p_buf.length);
66
72
                for (int i = 0; i < p_buf.length; i++)
67
73
                {
68
74
                        int l_int = (int)p_buf[i];