diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-11 06:01:44 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-12-11 06:01:44 +0000 |
commit | 29bc99605b3001024214877b685194229b053770 (patch) | |
tree | f893f1e4b64e027ecb12bd3ad323b84d9ba58a26 /java/src/Blob.java | |
parent | 00318e0f86593079270e84624efbcac2b1285aff (diff) | |
download | ATCD-poa_start.tar.gz |
This commit was manufactured by cvs2svn to create tag 'poa_start'.poa_start
Diffstat (limited to 'java/src/Blob.java')
-rw-r--r-- | java/src/Blob.java | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/java/src/Blob.java b/java/src/Blob.java deleted file mode 100644 index 69feef248b3..00000000000 --- a/java/src/Blob.java +++ /dev/null @@ -1,94 +0,0 @@ -/************************************************* - * - * = PACKAGE - * JACE.Connection - * - * = FILENAME - * Blob.java - * - *@author Prashant Jain - * - *************************************************/ -package JACE.Connection; - -import java.io.*; -import java.net.*; -import JACE.SOCK_SAP.*; -import JACE.ASX.*; -import JACE.OS.*; - -public class Blob -{ - public int open (String filename, String hostname , int port) - { - this.filename_ = filename; - this.hostname_ = hostname; - this.port_ = port; - return 0; - } - - public MessageBlock read (int length, int offset) - { - // Check if we have a valid length and a valid offset - if (length < 0 || offset < 0) - { - ACE.ERROR ("Blob::read(): Negative length or offset"); - return null; - } - - // Create a Blob Reader - BlobReader blobReader = new BlobReader (length, offset, this.filename_, this.hostname_, this.port_); - - // Receive data - MessageBlock mb = blobReader.receiveData (); - if (blobReader.bytesRead () != length) - return null; - else - return mb; - } - - public int write (MessageBlock mb, int length, int offset) - { - // Check if we have a valid length and a valid offset - if (length < 0 || offset < 0) - ACE.ERROR ("Blob::write(): Negative length or offset"); - - // Create a Blob Writer - BlobWriter blobWriter = new BlobWriter (mb, length, offset, this.filename_); - - try - { - // Connect to the server - this.connector_.open (this.hostname_, this.port_); - this.connector_.connect (blobWriter); - } - catch (UnknownHostException e) - { - ACE.ERROR (e); - } - catch (InstantiationException e) - { - ACE.ERROR (e); - } - catch (IllegalAccessException e) - { - ACE.ERROR (e); - } - catch (IOException e) - { - ACE.ERROR (e); - } - - return blobWriter.bytesWritten (); - } - - public int close () - { - return 0; - } - - String filename_; - String hostname_; - int port_; - Connector connector_ = new Connector (); -} |