1 18 package com.Ostermiller.util; 19 20 import java.io.*; 21 22 36 public class NoCloseInputStream extends InputStream implements NoCloseStream { 37 38 47 protected InputStream in; 48 49 56 public NoCloseInputStream(InputStream in){ 57 this.in = in; 58 } 59 60 63 public int read() throws IOException { 64 return in.read(); 65 } 66 67 70 public int read(byte[] b) throws IOException { 71 return in.read(b); 72 } 73 74 77 public int read(byte[] b, int off, int len) throws IOException { 78 return in.read(b, off, len); 79 } 80 81 84 public long skip(long n) throws IOException { 85 return in.skip(n); 86 } 87 88 91 public int available() throws IOException { 92 return in.available(); 93 } 94 95 102 public void close() throws IOException { 103 } 104 105 108 public void mark(int readlimit) { 109 in.mark(readlimit); 110 } 111 112 115 public void reset() throws IOException { 116 in.reset(); 117 } 118 119 122 public boolean markSupported(){ 123 return in.markSupported(); 124 } 125 126 129 public void reallyClose() throws IOException { 130 in.close(); 131 } 132 } 133 | Popular Tags |