1 16 package org.apache.commons.net.io; 17 18 import java.io.FilterOutputStream ; 19 import java.io.IOException ; 20 import java.io.OutputStream ; 21 import java.net.Socket ; 22 23 35 36 public class SocketOutputStream extends FilterOutputStream 37 { 38 private Socket __socket; 39 40 48 public SocketOutputStream(Socket socket, OutputStream stream) 49 { 50 super(stream); 51 __socket = socket; 52 } 53 54 55 67 public void write(byte buffer[], int offset, int length) throws IOException 68 { 69 out.write(buffer, offset, length); 70 } 71 72 73 80 public void close() throws IOException 81 { 82 super.close(); 83 __socket.close(); 84 } 85 } 86 | Popular Tags |