1 16 package org.apache.axis.transport.http; 17 18 19 import java.io.IOException ; 20 import java.io.InputStream ; 21 22 23 27 28 31 32 33 public class SocketInputStream extends java.io.FilterInputStream { 34 protected volatile boolean closed = false; 35 java.net.Socket socket= null; 36 37 private SocketInputStream() { 38 super(null); 39 } 40 41 42 public SocketInputStream(InputStream is, java.net.Socket socket) { 43 super(is); 44 this.socket= socket; 45 } 46 47 public void close() throws IOException { 48 synchronized(this){ 49 if(closed) return; 50 closed= true; 51 } 52 in.close(); 53 in= null; 54 socket.close(); 55 socket= null; 56 } 57 } 58 | Popular Tags |