1 5 package ve.luz.ica.remoteio; 6 7 import java.io.IOException ; 8 import java.io.InputStream ; 9 10 13 17 public class RemoteInputStreamImpl extends RemoteInputStreamPOA 18 { 19 21 private InputStream inputStream = null; 22 23 27 RemoteInputStreamImpl(InputStream stream) 28 { 29 this.inputStream = stream; 30 } 31 32 35 public int read(OctetSequenceHolder b, int len) throws RemoteIOException 36 { 37 try 38 { 39 b.value = new byte[len]; 40 int numBytes = inputStream.read(b.value, 0, len); 41 return numBytes; 42 } 43 catch (IOException e) 44 { 45 throw new RemoteIOException(e.getMessage()); 46 } 47 } 48 49 52 public void close() throws RemoteIOException 53 { 54 try 55 { 56 this.inputStream.close(); 57 } 58 catch (IOException e) 59 { 60 throw new RemoteIOException(e.getMessage()); 61 } 62 } 63 64 67 public int available() throws RemoteIOException 68 { 69 try 70 { 71 return this.inputStream.available(); 72 } 73 catch (IOException e) 74 { 75 throw new RemoteIOException(e.getMessage()); 76 } 77 } 78 79 82 public void mark(int readlimit) 83 { 84 this.inputStream.mark(readlimit); 85 } 86 87 90 public boolean markSupported() 91 { 92 return this.inputStream.markSupported(); 93 } 94 95 98 public void reset() throws RemoteIOException 99 { 100 try 101 { 102 this.inputStream.reset(); 103 } 104 catch (IOException e) 105 { 106 throw new RemoteIOException(e.getMessage()); 107 } 108 } 109 110 113 public long skip(long n) throws RemoteIOException 114 { 115 try 116 { 117 return this.inputStream.skip(n); 118 } 119 catch (IOException e) 120 { 121 throw new RemoteIOException(e.getMessage()); 122 } 123 } 124 125 } 126 | Popular Tags |