Add NullAppendable.
MODIFY
src/changes/changes.xml
src/changes/changes.xml
@@ -56,6 +56,9 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="add" due-to="Gary Gregory">
Add org.apache.commons.io.file.PathUtils.deleteDirectory(Path, FileVisitOption...).
</action>
+ <action dev="ggregory" type="add" due-to="Gary Gregory">
+ Add NullAppendable.
+ </action>
<action dev="ggregory" type="fix" due-to="Rob Spoor, Jochen Wiedmann">
CharSequenceReader.skip should return 0 instead of EOF on stream end #123.
</action>

ADD
src/main/java/org/apache/commons/io/output/NullAppendable.java
+/*
+ * 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.io.output;
+
+import java.io.IOException;
+
+/**
+ * Appends all data to the famous <b>/dev/null</b>.
+ * <p>
+ * This Appendable has no destination (file/socket etc.) and all characters written to it are ignored and lost.
+ * </p>
+ *
+ * @since 2.8
+ */
+public class NullAppendable implements Appendable {
+
+ /**
+ * A singleton.
+ */
+ public static final NullAppendable INSTANCE = new NullAppendable();
+
+ /** Use the singleton. */
+ private NullAppendable() {
+ // no instances.
+ }
+
+ @Override
+ public Appendable append(final char c) throws IOException {
+ return this;
+ }
+
+ @Override
+ public Appendable append(final CharSequence csq) throws IOException {
+ return this;
+ }
+
+ @Override
+ public Appendable append(final CharSequence csq, final int start, final int end) throws IOException {
+ return this;
+ }
+
+}

ADD
src/test/java/org/apache/commons/io/output/NullAppendableTest.java
+/*
+ * 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.io.output;
+
+import java.io.IOException;
+
+import org.junit.jupiter.api.Test;
+
+/**
+ * Really not a lot to do here, but checking that no Exceptions are thrown.
+ */
+public class NullAppendableTest {
+
+ @Test
+ public void testNull() throws IOException {
+ final char[] chars = new char[] {'A', 'B', 'C'};
+ final Appendable appendable = NullAppendable.INSTANCE;
+ appendable.append('a');
+ appendable.append("A");
+ appendable.append("A", 0, 1);
+ appendable.append(null, 0, 1);
+ appendable.append(null, -1, -1);
+ }
+
+}

Add NullAppendable.