<read>

Purpose/Function

Reads the indicated number of bytes into a String buffer, starting at the given offset.

NOTE: for scalability, one can use the <read-from-stream> task.

Attributes

NAME

TYPE

DEFAULT VALUE

DESCRIPTION

path

java.lang.String

required

file to read

offset

long

0

read from this byte

numBytes

long

-1

read this many bytes (-1 = up to the end of the file)

asByteArray

boolean

false

return bytes as an array; otherwise, return java.lang.String

Elements

None.

ReturnValues

DEFAULT NAME

TYPE

DESCRIPTION

fileContents

java.lang.String or array of byte

the read contents

Examples

...
<read path="${init.file}" offset="$E{10 * 1024}" numBytes="$E{20 * 1024}" asByteArray="true">
     <return-value defaultName="fileContents" assignedName="variableArray"/>
</read>
...
  • No labels