stevedlawrence commented on code in PR #1165: URL: https://github.com/apache/daffodil/pull/1165#discussion_r1501142750
########## daffodil-runtime1-layers/src/main/scala/org/apache/daffodil/layers/runtime1/Base64MimeLayer.scala: ########## @@ -0,0 +1,43 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.daffodil.layers.runtime1 + +import java.io.InputStream +import java.io.OutputStream +import java.util.Optional +import scala.collection.JavaConverters._ + +import org.apache.daffodil.runtime1.layers.api.JLayerLengthKind +import org.apache.daffodil.runtime1.layers.api.Layer +import org.apache.daffodil.runtime1.layers.api.LayerRuntime + +final class Base64MimeLayer + extends Layer( + layerName = "base64_MIME", + supportedLayerLengthKinds = Seq(JLayerLengthKind.BoundaryMark).asJava, Review Comment: I'll review this more in depth next week, but a single high level question: Is there a fundamental difference between limiting layers and a encode/decode layers? For example, could layers + lengths instead be something like: ```xml <sequence dfdl:layer="boundaryMark" ...> <sequence dfdl:layer="base64_MIME" ...> ... </sequence> </sequence> ``` So, could a "limiting layer" just be a layer that just reads/writes bytes 1-to-1, but stops transferring bytes at some point in the data. And an "encoding layer" is just a layer that transforms bytes up until it runs out of data? Which could be limited by a parent element with lengthKind="..." or something more complex layer like a boundary mark layer. And that could mean a single layer could be both a "limiting layer" and an "encode/decode" layer, i.e. a layer reads bytes up until some point that it determines it's done *and* transforms the bytes that it read. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
