java.lang.Object
io.smallrye.common.io.BufferSizeOption
- All Implemented Interfaces:
OpenOption
An
OpenOption that specifies the buffer size to use when opening something which supports buffering.
Instances are obtained via the of(int) or ofDefault() factory methods.
The default buffer size is DEFAULT_BUFFER_SIZE bytes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default buffer size.static final intThe smallest allowed buffer size. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the buffer size in bytes.booleanequals(BufferSizeOption obj) Returnstrueif the given option has the same buffer size as this one.booleanReturnstrueif the given object is aBufferSizeOptionwith the same buffer size.inthashCode()static BufferSizeOptionof(int bufferSize) Returns an option specifying the given buffer size.static BufferSizeOptionReturns an option specifying the default buffer size.toString()
-
Field Details
-
MIN_BUFFER_SIZE
public static final int MIN_BUFFER_SIZEThe smallest allowed buffer size. -
DEFAULT_BUFFER_SIZE
public static final int DEFAULT_BUFFER_SIZEThe default buffer size.
-
-
Method Details
-
of
Returns an option specifying the given buffer size. If the given buffer size is less than the minimum size, it will be rounded up to that size.- Parameters:
bufferSize- the buffer size in bytes (must be at least 1)- Returns:
- an option specifying the given buffer size
-
ofDefault
Returns an option specifying the default buffer size.- Returns:
- an option specifying the default buffer size
-
bufferSize
public int bufferSize()Returns the buffer size in bytes.- Returns:
- the buffer size in bytes
-
equals
Returnstrueif the given object is aBufferSizeOptionwith the same buffer size. -
equals
Returnstrueif the given option has the same buffer size as this one.- Parameters:
obj- the option to compare- Returns:
trueif the given option has the same buffer size as this one
-
hashCode
public int hashCode() -
toString
-