DataBufferUtils.java (spring-framework-5.3.23) | : | DataBufferUtils.java (spring-framework-5.3.24) | ||
---|---|---|---|---|
skipping to change at line 179 | skipping to change at line 179 | |||
*/ | */ | |||
public static Flux<DataBuffer> read( | public static Flux<DataBuffer> read( | |||
Path path, DataBufferFactory bufferFactory, int bufferSiz e, OpenOption... options) { | Path path, DataBufferFactory bufferFactory, int bufferSiz e, OpenOption... options) { | |||
Assert.notNull(path, "Path must not be null"); | Assert.notNull(path, "Path must not be null"); | |||
Assert.notNull(bufferFactory, "BufferFactory must not be null"); | Assert.notNull(bufferFactory, "BufferFactory must not be null"); | |||
Assert.isTrue(bufferSize > 0, "'bufferSize' must be > 0"); | Assert.isTrue(bufferSize > 0, "'bufferSize' must be > 0"); | |||
if (options.length > 0) { | if (options.length > 0) { | |||
for (OpenOption option : options) { | for (OpenOption option : options) { | |||
Assert.isTrue(!(option == StandardOpenOption.APPE ND || option == StandardOpenOption.WRITE), | Assert.isTrue(!(option == StandardOpenOption.APPE ND || option == StandardOpenOption.WRITE), | |||
"'" + option + "' not allowed"); | () -> "'" + option + "' not allow ed"); | |||
} | } | |||
} | } | |||
return readAsynchronousFileChannel(() -> AsynchronousFileChannel. open(path, options), | return readAsynchronousFileChannel(() -> AsynchronousFileChannel. open(path, options), | |||
bufferFactory, bufferSize); | bufferFactory, bufferSize); | |||
} | } | |||
/** | /** | |||
* Read the given {@code Resource} into a {@code Flux} of {@code DataBuff er}s. | * Read the given {@code Resource} into a {@code Flux} of {@code DataBuff er}s. | |||
* <p>If the resource is a file, it is read into an | * <p>If the resource is a file, it is read into an | |||
skipping to change at line 691 | skipping to change at line 691 | |||
if (this.longestDelimiter != NO_DELIMITER) { | if (this.longestDelimiter != NO_DELIMITER) { | |||
reset(); | reset(); | |||
return pos; | return pos; | |||
} | } | |||
} | } | |||
return -1; | return -1; | |||
} | } | |||
@Override | @Override | |||
public byte[] delimiter() { | public byte[] delimiter() { | |||
Assert.state(this.longestDelimiter != NO_DELIMITER, "Ille gal state!"); | Assert.state(this.longestDelimiter != NO_DELIMITER, "'del imiter' not set"); | |||
return this.longestDelimiter; | return this.longestDelimiter; | |||
} | } | |||
@Override | @Override | |||
public void reset() { | public void reset() { | |||
for (NestedMatcher matcher : this.matchers) { | for (NestedMatcher matcher : this.matchers) { | |||
matcher.reset(); | matcher.reset(); | |||
} | } | |||
} | } | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |