Package com.google.cloud.storage
Class StorageChannelUtils
java.lang.Object
com.google.cloud.storage.StorageChannelUtils
Set of utility methods for working with non-blocking channels returned by this library.
- Since:
- 2.56.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic intAttempt to emptybuftoc, blocking the invoking thread if necessary in order to do so.static intAttempt to fillbuffromc, blocking the invoking thread if necessary in order to do so.
-
Method Details
-
blockingFillFrom
Attempt to fillbuffromc, blocking the invoking thread if necessary in order to do so.This method will not close
c.- Returns:
- The number of bytes read, possibly zero, or
-1if the channel has reached end-of-stream - Throws:
IOException- any IOException from callingReadableByteChannel.read(ByteBuffer)- Since:
- 2.56.0
-
blockingEmptyTo
Attempt to emptybuftoc, blocking the invoking thread if necessary in order to do so.This method will not close
c- Returns:
- The number of bytes written, possibly zero
- Throws:
IOException- any IOException from callingWritableByteChannel.write(ByteBuffer)- Since:
- 2.56.0
-