Class StreamUtils
java.lang.Object
com.cloudbees.jenkins.support.util.StreamUtils
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
public final class StreamUtils
extends Object
Utility methods for handling files.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
closeQuietly
(Closeable closeable) Close resources quietly.static boolean
isNonWhitespaceControlCharacter
(byte[] b) Check if the content of a byte array is binarystatic boolean
Check if the content of a ByteBuffer is binary
-
Field Details
-
DEFAULT_PROBE_SIZE
public static final int DEFAULT_PROBE_SIZE- See Also:
-
-
Constructor Details
-
StreamUtils
public StreamUtils()
-
-
Method Details
-
isNonWhitespaceControlCharacter
public static boolean isNonWhitespaceControlCharacter(@NonNull byte[] b) Check if the content of a byte array is binary- Parameters:
b
- byte array to check- Returns:
- true if the content is binary (Non-white Control Characters)
-
isNonWhitespaceControlCharacter
Check if the content of a ByteBuffer is binary- Parameters:
head
- ByteBuffer to check- Returns:
- true if the content is binary (Non-white Control Characters)
-
closeQuietly
Close resources quietly.- Parameters:
closeable
- theCloseable
-