File tree 1 file changed +6
-4
lines changed
spring-core/src/main/java/org/springframework/core/io
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2019 the original author or authors.
2
+ * Copyright 2002-2020 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -150,9 +150,11 @@ public ReadableByteChannel readableChannel() throws IOException {
150
150
}
151
151
152
152
/**
153
- * This implementation reads the entire InputStream to calculate the
154
- * content length. Subclasses will almost always be able to provide
155
- * a more optimal version of this, e.g. checking a File length.
153
+ * This method reads the entire InputStream to determine the content length.
154
+ * <p>For a custom sub-class of {@code InputStreamResource}, we strongly
155
+ * recommend overriding this method with a more optimal implementation, e.g.
156
+ * checking File length, or possibly simply returning -1 if the stream can
157
+ * only be read once.
156
158
* @see #getInputStream()
157
159
*/
158
160
@ Override
You can’t perform that action at this time.
0 commit comments