1 24 25 26 package org.netbeans.modules.javadoc.httpfs; 27 28 29 import java.io.InputStream ; 30 import java.io.IOException ; 31 import java.net.HttpURLConnection ; 32 33 34 42 class HTTPFileInputStream extends InputStream { 43 44 private HttpURLConnection fileConnection; 46 private InputStream fileInputStream; 48 49 58 HTTPFileInputStream( HttpURLConnection fileConnection ) throws IOException { 59 60 this.fileConnection = fileConnection; 61 this.fileInputStream = this.fileConnection.getInputStream( ); 62 } 63 64 65 68 public int available() throws IOException { 69 70 return fileInputStream.available( ); 71 } 72 73 74 78 public void close( ) throws IOException { 79 80 fileInputStream.close( ); 82 fileConnection.disconnect( ); 83 } 84 85 86 89 public void mark( int param ) { 90 91 fileInputStream.mark( param ); 92 } 93 94 95 98 public boolean markSupported( ) { 99 100 return fileInputStream.markSupported( ); 101 } 102 103 104 107 public int read( ) throws IOException { 108 109 return fileInputStream.read( ); 110 } 111 112 113 116 public int read( byte[] values ) throws IOException { 117 118 return fileInputStream.read( values ); 119 } 120 121 122 125 public int read( byte[] values, int off, int len ) throws IOException { 126 127 return fileInputStream.read( values, off, len ); 128 } 129 130 131 134 public void reset( ) throws IOException { 135 136 fileInputStream.reset( ); 137 } 138 139 140 143 public long skip(long param ) throws IOException { 144 145 return fileInputStream.skip( param ); 146 } 147 } 148 | Popular Tags |