1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.log4j.config;
18
19 import java.io.IOException;
20 import java.io.InputStream;
21
22 class InputStreamWrapper extends InputStream {
23
24 private final String description;
25 private final InputStream input;
26
27 public InputStreamWrapper(final InputStream input, final String description) {
28 this.input = input;
29 this.description = description;
30 }
31
32 @Override
33 public int available() throws IOException {
34 return input.available();
35 }
36
37 @Override
38 public void close() throws IOException {
39 input.close();
40 }
41
42 @Override
43 public boolean equals(final Object obj) {
44 return input.equals(obj);
45 }
46
47 @Override
48 public int hashCode() {
49 return input.hashCode();
50 }
51
52 @Override
53 public synchronized void mark(final int readlimit) {
54 input.mark(readlimit);
55 }
56
57 @Override
58 public boolean markSupported() {
59 return input.markSupported();
60 }
61
62 @Override
63 public int read() throws IOException {
64 return input.read();
65 }
66
67 @Override
68 public int read(final byte[] b) throws IOException {
69 return input.read(b);
70 }
71
72 @Override
73 public int read(final byte[] b, final int off, final int len) throws IOException {
74 return input.read(b, off, len);
75 }
76
77 @Override
78 public synchronized void reset() throws IOException {
79 input.reset();
80 }
81
82 @Override
83 public long skip(final long n) throws IOException {
84 return input.skip(n);
85 }
86
87 @Override
88 public String toString() {
89 return getClass().getSimpleName() + " [description=" + description + ", input=" + input + "]";
90 }
91
92 }