Package org.alfresco.repo.remote
Class RepoRemoteInputStream
- java.lang.Object
-
- java.io.InputStream
-
- org.alfresco.repo.remote.RepoRemoteInputStream
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
public class RepoRemoteInputStream extends java.io.InputStreamA wrapper implementation of InputStream to work with a RepoRemoteTransport instance.- Author:
- britt
-
-
Constructor Summary
Constructors Constructor Description RepoRemoteInputStream(java.lang.String handle, RepoRemoteTransport remote, ClientTicketHolder ticketHolder)Construct one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Close the underlying AVMRemote handle.intread()Read in a single byte.intread(byte[] b, int off, int len)Read a buffer of bytes.
-
-
-
Constructor Detail
-
RepoRemoteInputStream
public RepoRemoteInputStream(java.lang.String handle, RepoRemoteTransport remote, ClientTicketHolder ticketHolder)Construct one.- Parameters:
handle- The handle returned by getInputStream();remote- The AVMRemote instance.
-
-
Method Detail
-
read
public int read() throws java.io.IOExceptionRead in a single byte.- Specified by:
readin classjava.io.InputStream- Returns:
- The byte as 0-255 or -1 for eof.
- Throws:
java.io.IOException
-
read
public int read(byte[] b, int off, int len) throws java.io.IOExceptionRead a buffer of bytes.- Overrides:
readin classjava.io.InputStream- Parameters:
b- The buffer into which to put the bytes.off- The offset into the buffer.len- The number of bytes to read.- Returns:
- The actual number of bytes read or -1 on eof.
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOExceptionClose the underlying AVMRemote handle.- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classjava.io.InputStream- Throws:
java.io.IOException
-
-