Package org.infinispan.util.stream
Class Streams
java.lang.Object
org.infinispan.util.stream.Streams
Deprecated, for removal: This API element is subject to removal in a future version.
Since 10.0. This will be removed in next major version.
A collection of I/O stream related utility methods.
Exceptions that are thrown and not explicitly declared are ignored.
- Since:
- 4.2
- Author:
- Jason Dillon
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated, for removal: This API element is subject to removal in a future version.The default buffer size that will be used for buffered operations. -
Constructor Summary
ConstructorsConstructorDescriptionStreams()Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanclose(InputStream stream) Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an InputStream.static booleanclose(InputStream[] streams) Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an array of InputStreams.static booleanclose(OutputStream stream) Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an OutputStream.static booleanclose(OutputStream[] streams) Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an array of OutputStreams.static booleanDeprecated, for removal: This API element is subject to removal in a future version.Attempt to close an InputStream or OutputStream.static booleanDeprecated, for removal: This API element is subject to removal in a future version.Attempt to close an array of InputStreama and/or OutputStreams.static longcopy(InputStream input, OutputStream output) Deprecated, for removal: This API element is subject to removal in a future version.Copy all of the bytes from the input stream to the output stream.static longcopy(InputStream input, OutputStream output, byte[] buffer) Deprecated, for removal: This API element is subject to removal in a future version.Copy all of the bytes from the input stream to the output stream.static longcopy(InputStream input, OutputStream output, int size) Deprecated, for removal: This API element is subject to removal in a future version.Copy all of the bytes from the input stream to the output stream.static longcopyb(InputStream input, OutputStream output) Deprecated, for removal: This API element is subject to removal in a future version.Copy all of the bytes from the input stream to the output stream wrapping streams in buffers as needed.static longcopySome(InputStream input, OutputStream output, byte[] buffer, long length) Deprecated, for removal: This API element is subject to removal in a future version.Copy a limited number of bytes from the input stream to the output stream.static longcopySome(InputStream input, OutputStream output, int size, long length) Deprecated, for removal: This API element is subject to removal in a future version.Copy a limited number of bytes from the input stream to the output stream.static longcopySome(InputStream input, OutputStream output, long length) Deprecated, for removal: This API element is subject to removal in a future version.Copy a limited number of bytes from the input stream to the output stream.static booleanfclose(OutputStream stream) Deprecated, for removal: This API element is subject to removal in a future version.Attempt to flush and close an OutputStream.static booleanfclose(OutputStream[] streams) Deprecated, for removal: This API element is subject to removal in a future version.Attempt to flush and close an array of OutputStreams.static booleanflush(OutputStream stream) Deprecated, for removal: This API element is subject to removal in a future version.Attempt to flush an OutputStream.static booleanflush(OutputStream[] streams) Deprecated, for removal: This API element is subject to removal in a future version.Attempt to flush an array of OutputStreams.
-
Field Details
-
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZEDeprecated, for removal: This API element is subject to removal in a future version.The default buffer size that will be used for buffered operations.- See Also:
-
-
Constructor Details
-
Streams
public Streams()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
close
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an InputStream.- Parameters:
stream- InputStream to attempt to close.- Returns:
- True if stream was closed (or stream was null), or false if an exception was thrown.
-
close
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an OutputStream.- Parameters:
stream- OutputStream to attempt to close.- Returns:
- True if stream was closed (or stream was null), or false if an exception was thrown.
-
close
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an InputStream or OutputStream.- Parameters:
stream- Stream to attempt to close.- Returns:
- True if stream was closed (or stream was null), or false if an exception was thrown.
- Throws:
IllegalArgumentException- Stream is not an InputStream or OuputStream.
-
close
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an array of InputStreams.- Parameters:
streams- Array of InputStreams to attempt to close.- Returns:
- True if all streams were closed, or false if an exception was thrown.
-
close
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an array of OutputStreams.- Parameters:
streams- Array of OutputStreams to attempt to close.- Returns:
- True if all streams were closed, or false if an exception was thrown.
-
close
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to close an array of InputStreama and/or OutputStreams.- Parameters:
streams- Array of streams to attempt to close.- Returns:
- True if all streams were closed, or false if an exception was thrown.
- Throws:
IllegalArgumentException- Stream is not an InputStream or OuputStream. Closing stops at the last valid stream object in this case.
-
fclose
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to flush and close an OutputStream.- Parameters:
stream- OutputStream to attempt to flush and close.- Returns:
- True if stream was flushed and closed, or false if an exception was thrown.
-
fclose
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to flush and close an array of OutputStreams.- Parameters:
streams- OutputStreams to attempt to flush and close.- Returns:
- True if all streams were flushed and closed, or false if an exception was thrown.
-
flush
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to flush an OutputStream.- Parameters:
stream- OutputStream to attempt to flush.- Returns:
- True if stream was flushed (or stream was null), or false if an exception was thrown.
-
flush
Deprecated, for removal: This API element is subject to removal in a future version.Attempt to flush an array of OutputStreams.- Parameters:
streams- OutputStreams to attempt to flush.- Returns:
- True if all streams were flushed, or false if an exception was thrown.
-
copy
Deprecated, for removal: This API element is subject to removal in a future version.Copy all of the bytes from the input stream to the output stream.- Parameters:
input- Stream to read bytes from.output- Stream to write bytes to.buffer- The buffer to use while copying.- Returns:
- The total number of bytes copied.
- Throws:
IOException- Failed to copy bytes.
-
copy
Deprecated, for removal: This API element is subject to removal in a future version.Copy all of the bytes from the input stream to the output stream.- Parameters:
input- Stream to read bytes from.output- Stream to write bytes to.size- The size of the buffer to use while copying.- Returns:
- The total number of bytes copied.
- Throws:
IOException- Failed to copy bytes.
-
copy
Deprecated, for removal: This API element is subject to removal in a future version.Copy all of the bytes from the input stream to the output stream.- Parameters:
input- Stream to read bytes from.output- Stream to write bytes to.- Returns:
- The total number of bytes copied.
- Throws:
IOException- Failed to copy bytes.
-
copyb
Deprecated, for removal: This API element is subject to removal in a future version.Copy all of the bytes from the input stream to the output stream wrapping streams in buffers as needed.- Parameters:
input- Stream to read bytes from.output- Stream to write bytes to.- Returns:
- The total number of bytes copied.
- Throws:
IOException- Failed to copy bytes.
-
copySome
public static long copySome(InputStream input, OutputStream output, byte[] buffer, long length) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Copy a limited number of bytes from the input stream to the output stream.- Parameters:
input- Stream to read bytes from.output- Stream to write bytes to.buffer- The buffer to use while copying.length- The maximum number of bytes to copy.- Returns:
- The total number of bytes copied.
- Throws:
IOException- Failed to copy bytes.
-
copySome
public static long copySome(InputStream input, OutputStream output, int size, long length) throws IOException Deprecated, for removal: This API element is subject to removal in a future version.Copy a limited number of bytes from the input stream to the output stream.- Parameters:
input- Stream to read bytes from.output- Stream to write bytes to.size- The size of the buffer to use while copying.length- The maximum number of bytes to copy.- Returns:
- The total number of bytes copied.
- Throws:
IOException- Failed to copy bytes.
-
copySome
Deprecated, for removal: This API element is subject to removal in a future version.Copy a limited number of bytes from the input stream to the output stream.- Parameters:
input- Stream to read bytes from.output- Stream to write bytes to.length- The maximum number of bytes to copy.- Returns:
- The total number of bytes copied.
- Throws:
IOException- Failed to copy bytes.
-