2 * Copyright (C) 2014, United States Government, as represented by the
3 * Administrator of the National Aeronautics and Space Administration.
6 * The Java Pathfinder core (jpf-core) platform is licensed under the
7 * Apache License, Version 2.0 (the "License"); you may not use this file except
8 * in compliance with the License. You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0.
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
19 package gov.nasa.jpf.util;
21 import java.io.PrintStream;
22 import java.io.ByteArrayOutputStream;
23 import java.util.Locale;
26 * a PrintStream that doesn't print anything
28 public class DevNullPrintStream extends PrintStream {
30 public DevNullPrintStream(){
31 super( new ByteArrayOutputStream());
39 public boolean checkError(){
43 protected void setError(){}
45 protected void clearError(){}
48 public void write(int a){}
50 public void write(byte[] a, int b, int c){}
52 public void print(boolean a){}
54 public void print(char a){}
56 public void print(int a){}
58 public void print(long a){}
60 public void print(float a){}
62 public void print(double a){}
64 public void print(char[] a){}
66 public void print(String a){}
68 public void print(Object a){}
70 public void println(){}
72 public void println(boolean a){}
74 public void println(char a){}
76 public void println(int a){}
78 public void println(long a){}
80 public void println(float a){}
82 public void println(double a){}
84 public void println(char[] a){}
86 public void println(String a){}
88 public void println(Object a){}
91 public PrintStream printf(String a, Object... b){ return this; }
93 public PrintStream printf(Locale a, String b, Object... c){ return this; }
95 public PrintStream format(String a, Object... b){ return this; }
97 public PrintStream format(Locale a, String b, Object... c){ return this; }
99 public PrintStream append(CharSequence a){ return this; }
101 public PrintStream append(CharSequence a, int b, int c){ return this; }
103 public PrintStream append(char a){ return this; }