mirror of
https://github.com/corda/corda.git
synced 2025-06-13 04:38:19 +00:00
Added a getContentLength() method to URLConnection
This is particularly important if you want to get the number of bytes of a resource loaded by the class loader: getClass().getResource("myFile").openConnection().getContentLength()
This commit is contained in:
@ -25,6 +25,10 @@ public abstract class URLConnection {
|
||||
return getInputStream();
|
||||
}
|
||||
|
||||
public int getContentLength() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
public InputStream getInputStream() throws IOException {
|
||||
throw new UnknownServiceException();
|
||||
}
|
||||
|
Reference in New Issue
Block a user