public class ReadContentStreamPart extends AbstractOperation<byte[]>
Operation
that reads the next n bytes from a remote stream attached to a session.Constructor and Description |
---|
ReadContentStreamPart(SessionDataKey streamKey,
int numberOfBytesToRead)
This creates a new
operation that reads the given number of bytes
from the stream the current session has stored with the given key. |
Modifier and Type | Method and Description |
---|---|
byte[] |
invoke()
The method that will be called on the server side.
|
afterInvoke, getResult, toArrayList, toString
beforeInvoke, getClientToken, mapException
public ReadContentStreamPart(SessionDataKey streamKey, int numberOfBytesToRead)
operation
that reads the given number of bytes
from the stream the current session has stored with the given key.
Like InputStream.read(byte[], int, int)
it is possible for various reasons that a number of bytes will
be read that is less than the given number. The invoke method
will
return a array with exactly the bytes read, so its length will be the number of bytes read.streamKey
- The key with which the current session associates the stream to read from. Must not be null.numberOfBytesToRead
- the number of bytes to read from the stream. Must be greater than 0.public byte[] invoke() throws SaBasicException
Operation
SaBasicException
- exception when invoking this operationCopyright © 2016 SAPERION AG. All rights reserved.