1 29 package com.caucho.db.sql; 30 31 import com.caucho.db.store.BlobInputStream; 32 import com.caucho.db.store.Store; 33 import com.caucho.util.L10N; 34 35 import java.io.InputStream ; 36 import java.io.OutputStream ; 37 import java.sql.Blob ; 38 import java.sql.SQLException ; 39 40 43 public class BlobImpl implements java.sql.Blob { 44 private static final L10N L = new L10N(BlobImpl.class); 45 46 private Store _store; 47 private byte []_inode = new byte[128]; 48 49 BlobImpl() 50 { 51 } 52 53 void setStore(Store store) 54 { 55 _store = store; 56 } 57 58 byte []getInode() 59 { 60 return _inode; 61 } 62 63 66 public InputStream getBinaryStream() 67 throws SQLException 68 { 69 return new BlobInputStream(_store, _inode, 0); 70 } 71 72 75 public byte []getBytes(long pos, int length) 76 throws SQLException 77 { 78 throw new UnsupportedOperationException (); 79 } 80 81 84 public long length() 85 throws SQLException 86 { 87 return BlobInputStream.readLong(_inode, 0); 88 } 89 90 93 public long position(Blob pattern, long start) 94 throws SQLException 95 { 96 throw new UnsupportedOperationException (); 97 } 98 99 102 public long position(byte []pattern, long start) 103 throws SQLException 104 { 105 throw new UnsupportedOperationException (); 106 } 107 108 111 public OutputStream setBinaryStream(long pos) 112 throws SQLException 113 { 114 throw new UnsupportedOperationException (); 115 } 116 117 120 public int setBytes(long pos, byte []bytes) 121 throws SQLException 122 { 123 return setBytes(pos, bytes, 0, bytes.length); 124 } 125 126 129 public int setBytes(long pos, byte []bytes, int offset, int length) 130 throws SQLException 131 { 132 throw new UnsupportedOperationException (); 133 } 134 135 138 public void truncate(long length) 139 throws SQLException 140 { 141 throw new UnsupportedOperationException (); 142 } 143 144 public String toString() 145 { 146 return "BlobImpl[]"; 147 } 148 } 149 | Popular Tags |