This is an automated email from the ASF dual-hosted git repository.
mbeckerle pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/daffodil-site.git
The following commit(s) were added to refs/heads/main by this push:
new 4213997 Update layer doc for byteSwapLayer requireLengthInWholeWords
feature.
4213997 is described below
commit 42139971336b9a79a7a0aff310587d155a33faa9
Author: Michael Beckerle <[email protected]>
AuthorDate: Fri May 31 11:00:40 2024 -0400
Update layer doc for byteSwapLayer requireLengthInWholeWords feature.
DAFFODIL-2509
---
site/layers.md | 22 ++++++++++++++--------
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/site/layers.md b/site/layers.md
index 06ebee6..a25605e 100644
--- a/site/layers.md
+++ b/site/layers.md
@@ -535,23 +535,29 @@ for the boundary mark string.
- `twobyteswap`
- `fourbyteswap`
- Namespace URI: urn:org.apache.daffodil.layers.byteSwap
-- Parameter Variables: None
+- Parameter Variables:
+ - `requireLengthInWholeWords` - an `xs:string` which can be "yes" or "no".
Defaults to "no".
+ Indicates whether it is a processing error if the layer length turns out to
not be a
+ multiple of the word size. If bound to a string other than "yes" or "no" it
is a Schema Definition
+ Error.
- Result Variables: None
-Layer that re-orders bytes according to the word size which is 2 for
`twobyteswap` and 4 for
+Layers that re-order bytes according to the word size which is 2 for
`twobyteswap` and 4 for
`fourbyteswap` respectively.
-This layer implements streaming behavior.
-It does not require buffering up the data.
-So it can be used on very large data objects.
+These layers implement streaming behavior, meaning they do not require
buffering up the data;
+hence, they can be used on very large data objects.
Bytes within the wrapped input stream are re-ordered _word size_ bytes at a
time.
-For example, if
+For example, with the `requireLengthInWholeWords` as "no" (the default), if
the wrapped input stream contains 10 bytes and word size is 4, then the bytes
from the wrapped
-input stream are returned in the order 4 3 2 1 8 7 6 5 10 9.
-
+input stream are returned in the order 4 3 2 1 8 7 6 5 10 9. Note that the
last 4-byte word is
+incomplete, but the 2 available bytes are re-ordered anyway.
If wordsize were 2 then the bytes from the wrapped input stream are returned
in the
order 2 1 4 3 6 5 8 7 10 9.
+If `requireLengthInWholeWords` is bound to "yes", then if the length is not a
multiple of the
+word size a processing error occurs.
+
----
### FixedLength Layer