public class NSURLSessionStreamTask extends NSURLSessionTask
NSURLSessionStreamTask can be used to perform asynchronous reads and writes. Reads and writes are enquened and executed serially, with the completion handler being invoked on the sessions delegate queuee. If an error occurs, or the task is canceled, all outstanding read and write calls will have their completion handlers invoked with an appropriate error.
It is also possible to create NSInputStream and NSOutputStream instances from an NSURLSessionTask by sending -captureStreams to the task. All outstanding read and writess are completed before the streams are created. Once the streams are delivered to the session delegate, the task is considered complete and will receive no more messsages. These streams are disassociated from the underlying session.
| Modifier and Type | Class and Description |
|---|---|
static interface |
NSURLSessionStreamTask.Block_readDataOfMinLengthMaxLengthTimeoutCompletionHandler |
static interface |
NSURLSessionStreamTask.Block_writeDataTimeoutCompletionHandler |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
NSURLSessionStreamTask(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static NSURLSessionStreamTask |
alloc() |
static NSURLSessionStreamTask |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
void |
captureStreams()
-captureStreams completes any already enqueued reads
and writes, and then invokes the
URLSession:streamTask:didBecomeInputStream:outputStream: delegate
message.
|
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
void |
closeRead()
Enqueue a request to close the read side of the underlying socket.
|
void |
closeWrite()
Enqueue a request to close the write end of the underlying socket.
|
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
static long |
hash_static() |
NSURLSessionStreamTask |
init() |
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static NSURLSessionStreamTask |
new_objc() |
void |
readDataOfMinLengthMaxLengthTimeoutCompletionHandler(long minBytes,
long maxBytes,
double timeout,
NSURLSessionStreamTask.Block_readDataOfMinLengthMaxLengthTimeoutCompletionHandler completionHandler)
Read minBytes, or at most maxBytes bytes and invoke the completion
handler on the sessions delegate queue with the data or an error.
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
static void |
setVersion_static(long aVersion) |
void |
startSecureConnection()
Begin encrypted handshake.
|
void |
stopSecureConnection()
Cleanly close a secure connection after all pending secure IO has
completed.
|
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
void |
writeDataTimeoutCompletionHandler(NSData data,
double timeout,
NSURLSessionStreamTask.Block_writeDataTimeoutCompletionHandler completionHandler)
Write the data completely to the underlying socket.
|
cancel, copyWithZone, countOfBytesClientExpectsToReceive, countOfBytesClientExpectsToSend, countOfBytesExpectedToReceive, countOfBytesExpectedToSend, countOfBytesReceived, countOfBytesSent, currentRequest, delegate, earliestBeginDate, error, originalRequest, prefersIncrementalDelivery, priority, progress, response, resume, setCountOfBytesClientExpectsToReceive, setCountOfBytesClientExpectsToSend, setDelegate, setEarliestBeginDate, setPrefersIncrementalDelivery, setPriority, setTaskDescription, state, suspend, taskDescription, taskIdentifieraccessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeyprotected NSURLSessionStreamTask(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static NSURLSessionStreamTask alloc()
public static NSURLSessionStreamTask allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public static long hash_static()
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static NSURLSessionStreamTask new_objc()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()
public void captureStreams()
public void closeRead()
public void closeWrite()
public NSURLSessionStreamTask init()
init in class NSURLSessionTaskpublic void readDataOfMinLengthMaxLengthTimeoutCompletionHandler(long minBytes,
long maxBytes,
double timeout,
NSURLSessionStreamTask.Block_readDataOfMinLengthMaxLengthTimeoutCompletionHandler completionHandler)
public void startSecureConnection()
public void stopSecureConnection()
[@warning] This API is non-functional.
public void writeDataTimeoutCompletionHandler(NSData data, double timeout, NSURLSessionStreamTask.Block_writeDataTimeoutCompletionHandler completionHandler)