org.openmdx.base.stream.rmi.jrmp
Class BinarySource_1

java.lang.Object
  extended by java.rmi.server.RemoteObject
      extended by java.rmi.server.RemoteServer
          extended by java.rmi.server.UnicastRemoteObject
              extended by org.openmdx.base.stream.rmi.jrmp.BinarySource_1
All Implemented Interfaces:
Serializable, Remote, Source_1_0, BinarySource_1_0

public class BinarySource_1
extends UnicastRemoteObject
implements BinarySource_1_0

Binary Source 1.0 JRMP Implementation

See Also:
Serialized Form

Field Summary
protected  InputStream in
           
 
Fields inherited from class java.rmi.server.RemoteObject
ref
 
Constructor Summary
BinarySource_1(InputStream binaryStream)
          Creates an StreamSource_1 so that it uses in as its source.
BinarySource_1(InputStream binaryStream, long length)
          Creates an StreamSource_1 so that it uses in as its source.
 
Method Summary
 void close()
          Closes this iterator and releases any system resources associated with it.
protected  boolean isOpen()
           
 long length()
          Get the stream's length
 byte[] readBytes(int capacity)
          Updates all or part of the BLOB value that this Blob object represents, as an array of bytes.
 
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, unexportObject
 
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
 
Methods inherited from class java.rmi.server.RemoteObject
equals, getRef, hashCode, toString, toStub
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

in

protected InputStream in
Constructor Detail

BinarySource_1

public BinarySource_1(InputStream binaryStream,
                      long length)
               throws IOException
Creates an StreamSource_1 so that it uses in as its source.

Parameters:
delegate - the underlying binary stream.
length - The number of bytes in the stream or -1 if it is unknown.
Throws:
IOException - if an I/O error occurs.

BinarySource_1

public BinarySource_1(InputStream binaryStream)
               throws IOException
Creates an StreamSource_1 so that it uses in as its source.

Parameters:
delegate - the underlying binary stream.
length - The number of bytes in the stream or -1 if it is unknown.
Throws:
IOException - if an I/O error occurs.
Method Detail

isOpen

protected boolean isOpen()

close

public void close()
           throws IOException
Closes this iterator and releases any system resources associated with it.

No read() operation must be invoked after close().

Specified by:
close in interface Source_1_0
Throws:
IOException - if an I/O error occurs.

readBytes

public byte[] readBytes(int capacity)
                 throws IOException
Updates all or part of the BLOB value that this Blob object represents, as an array of bytes. This byte array contains up to length consecutive bytes starting at the specified position.

Specified by:
readBytes in interface BinarySource_1_0
Parameters:
capacity - the number of consecutive bytes to be copied
Returns:
a byte array containing up to capacity consecutive bytes from the BLOB; or null in case of an end of stream condition
Throws:
IOException - if an I/O error occurs.

length

public long length()
            throws IOException
Description copied from interface: Source_1_0
Get the stream's length

Specified by:
length in interface Source_1_0
Returns:
the length of the stream or -1 if it is unknown.
Throws:
IOException


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.