1 50 package net.sf.just4log.util; 51 52 import java.io.IOException ; 53 import java.io.InputStream ; 54 55 58 59 public class NotClosingInputStream extends InputStream { 60 private InputStream input; 61 64 public NotClosingInputStream(InputStream in) { 65 setInput(in); 66 } 67 68 71 public int read() throws IOException { 72 return input.read(); 73 } 74 75 78 public int available() throws IOException { 79 return input.available(); 80 } 81 82 85 public void close() throws IOException { 86 } 89 90 93 public synchronized void mark(int readlimit) { 94 95 input.mark(readlimit); 96 } 97 98 101 public boolean markSupported() { 102 return input.markSupported(); 103 } 104 105 108 public int read(byte[] b, int off, int len) throws IOException { 109 return input.read(b, off, len); 110 } 111 112 115 public int read(byte[] b) throws IOException { 116 return input.read(b); 117 } 118 119 122 public synchronized void reset() throws IOException { 123 input.reset(); 124 } 125 126 129 public long skip(long n) throws IOException { 130 return input.skip(n); 131 } 132 133 136 public InputStream getInput() { 137 return input; 138 } 139 140 143 public void setInput(InputStream stream) { 144 input = stream; 145 } 146 147 } 148 | Popular Tags |