KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > rmi > server > RmiBlobServerSide


1 package com.daffodilwoods.rmi.server;
2
3  import java.rmi.*;
4  import java.sql.*;
5  import java.rmi.server.*;
6  import com.daffodilwoods.daffodildb.server.datasystem.persistentsystem.DBlobUpdatable;
7  import com.daffodilwoods.rmi.interfaces.*;
8 public class RmiBlobServerSide extends UnicastRemoteObject implements _RmiBlob{
9
10   Blob blob;
11
12   public RmiBlobServerSide(Blob blob) throws RemoteException{
13     super();
14     this.blob = blob;
15   }
16
17   public long length() throws SQLException , RemoteException{
18     return blob.length();
19   }
20
21   public byte[] getBytes(long pos, int length) throws SQLException , RemoteException {
22       return blob.getBytes(pos,length);
23   }
24   public _RmiInputStream getBinaryStream() throws SQLException , RemoteException {
25       return new RmiInputStreamServerSide(blob.getBinaryStream());
26   }
27   public long position(byte pattern[], long start) throws SQLException , RemoteException {
28       return blob.position(pattern,start);
29   }
30   public long position(Blob pattern, long start) throws SQLException , RemoteException {
31       return blob.position(pattern,start);
32   }
33
34   public int setBytes(long pos, byte[] bytes, int offset, int len) throws SQLException , RemoteException {
35       return blob.setBytes(pos,bytes,offset,len);
36   }
37
38
39   public _RmiOutputStream setBinaryStream(long pos) throws SQLException , RemoteException {
40       return new RmiOutputStreamServerSide(blob.setBinaryStream(pos));
41   }
42
43   public void truncate(long len) throws SQLException , RemoteException {
44        blob.truncate(len);
45   }
46 }
47
Popular Tags