garydgregory commented on code in PR #455: URL: https://github.com/apache/commons-compress/pull/455#discussion_r1439023886
########## src/main/java/org/apache/commons/compress/archivers/zip/RandomAccessOutputStream.java: ########## @@ -0,0 +1,70 @@ +/* + * 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.commons.compress.archivers.zip; + +import java.io.IOException; +import java.io.OutputStream; + + +/** + * Abstraction over OutputStream which also allows random access writes. + */ +abstract class RandomAccessOutputStream extends OutputStream { Review Comment: Hello @kvr000 and Happy New Year! The API design does not feel quite right to me. A `SeekableByteChannel` has `position()` and `position(long)`, and `RandomAccessFile` has `getFilePointer()` and `seek(long)`. In both cases, there is one API for "where am I?" and another for "go to this location". I think we should have the same here. This avoids adding a "position" argument everytime a new API is needed in this method. It also could let the implementation decide if a write is "full" or not. Avoiding the need for "fully" APIs in the first place. Thoughts? @elharo, any thoughts here? -- 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]
