comparison src/main/gov/nasa/jpf/util/DevNullPrintStream.java @ 0:61d41facf527

initial v8 import (history reset)
author Peter Mehlitz <Peter.C.Mehlitz@nasa.gov>
date Fri, 23 Jan 2015 10:14:01 -0800
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:61d41facf527
1 /*
2 * Copyright (C) 2014, United States Government, as represented by the
3 * Administrator of the National Aeronautics and Space Administration.
4 * All rights reserved.
5 *
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
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0.
11 *
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.
17 */
18
19 package gov.nasa.jpf.util;
20
21 import java.io.PrintStream;
22 import java.io.ByteArrayOutputStream;
23 import java.util.Locale;
24
25 /**
26 * a PrintStream that doesn't print anything
27 */
28 public class DevNullPrintStream extends PrintStream {
29
30 public DevNullPrintStream(){
31 super( new ByteArrayOutputStream());
32 }
33
34 @Override
35 public void flush(){}
36 @Override
37 public void close(){}
38 @Override
39 public boolean checkError(){
40 return false;
41 }
42 @Override
43 protected void setError(){}
44 @Override
45 protected void clearError(){}
46
47 @Override
48 public void write(int a){}
49 @Override
50 public void write(byte[] a, int b, int c){}
51 @Override
52 public void print(boolean a){}
53 @Override
54 public void print(char a){}
55 @Override
56 public void print(int a){}
57 @Override
58 public void print(long a){}
59 @Override
60 public void print(float a){}
61 @Override
62 public void print(double a){}
63 @Override
64 public void print(char[] a){}
65 @Override
66 public void print(String a){}
67 @Override
68 public void print(Object a){}
69 @Override
70 public void println(){}
71 @Override
72 public void println(boolean a){}
73 @Override
74 public void println(char a){}
75 @Override
76 public void println(int a){}
77 @Override
78 public void println(long a){}
79 @Override
80 public void println(float a){}
81 @Override
82 public void println(double a){}
83 @Override
84 public void println(char[] a){}
85 @Override
86 public void println(String a){}
87 @Override
88 public void println(Object a){}
89
90 @Override
91 public PrintStream printf(String a, Object... b){ return this; }
92 @Override
93 public PrintStream printf(Locale a, String b, Object... c){ return this; }
94 @Override
95 public PrintStream format(String a, Object... b){ return this; }
96 @Override
97 public PrintStream format(Locale a, String b, Object... c){ return this; }
98 @Override
99 public PrintStream append(CharSequence a){ return this; }
100 @Override
101 public PrintStream append(CharSequence a, int b, int c){ return this; }
102 @Override
103 public PrintStream append(char a){ return this; }
104
105 }