Class BufferUtil
- java.lang.Object
-
- io.fabric8.kubernetes.client.http.BufferUtil
-
public class BufferUtil extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ByteBuffer
copy(ByteBuffer buffer)
Copy of a ByteBuffer into a heap bufferstatic boolean
isPlainText(ByteBuffer originalBuffer)
Very rudimentary method to check if the provided ByteBuffer contains text.static byte[]
toArray(ByteBuffer buffer)
Convert a ByteBuffer to a byte array.static byte[]
toArray(Collection<ByteBuffer> buffers)
-
-
-
Method Detail
-
toArray
public static byte[] toArray(ByteBuffer buffer)
Convert a ByteBuffer to a byte array.- Parameters:
buffer
- The buffer to convert in flush mode. The buffer is not altered.- Returns:
- An array of bytes duplicated from the buffer.
-
toArray
public static byte[] toArray(Collection<ByteBuffer> buffers)
-
copy
public static ByteBuffer copy(ByteBuffer buffer)
Copy of a ByteBuffer into a heap buffer- Parameters:
buffer
- The buffer to copy.- Returns:
- A copy of the provided buffer.
-
isPlainText
public static boolean isPlainText(ByteBuffer originalBuffer)
Very rudimentary method to check if the provided ByteBuffer contains text.- Returns:
- true if the buffer contains text, false otherwise.
-
-