summaryrefslogtreecommitdiff
path: root/SmartDeviceLink/SDLUploadFileOperation.m
diff options
context:
space:
mode:
authorNicoleYarroch <nicole@livio.io>2017-08-02 14:37:26 -0400
committerNicoleYarroch <nicole@livio.io>2017-08-02 14:37:26 -0400
commitee9a98b480c7d03631c3042584ca59baaf27318b (patch)
treef3fa13105ab7eb6fa67768cb24a12dd07ddce77a /SmartDeviceLink/SDLUploadFileOperation.m
parentb99a39a683b94954663767af396d04ebf78e8ef9 (diff)
downloadsdl_ios-ee9a98b480c7d03631c3042584ca59baaf27318b.tar.gz
Converted 3 instance functions to class functions
Signed-off-by: NicoleYarroch <nicole@livio.io>
Diffstat (limited to 'SmartDeviceLink/SDLUploadFileOperation.m')
-rw-r--r--SmartDeviceLink/SDLUploadFileOperation.m12
1 files changed, 6 insertions, 6 deletions
diff --git a/SmartDeviceLink/SDLUploadFileOperation.m b/SmartDeviceLink/SDLUploadFileOperation.m
index b2c66198d..9f6641818 100644
--- a/SmartDeviceLink/SDLUploadFileOperation.m
+++ b/SmartDeviceLink/SDLUploadFileOperation.m
@@ -90,11 +90,11 @@ NS_ASSUME_NONNULL_BEGIN
// The putfile's length parameter is based on the current offset
SDLPutFile *putFile = [[SDLPutFile alloc] initWithFileName:file.name fileType:file.fileType persistentFile:file.isPersistent];
putFile.offset = @(currentOffset);
- putFile.length = @([self sdl_getPutFileLengthForOffset:currentOffset fileSize:file.fileSize mtuSize:mtuSize]);
+ putFile.length = @([[self class] sdl_getPutFileLengthForOffset:currentOffset fileSize:file.fileSize mtuSize:mtuSize]);
// Get a chunk of data from the input stream
- NSUInteger dataSize = [self sdl_getDataSizeForOffset:currentOffset fileSize:file.fileSize mtuSize:mtuSize];
- putFile.bulkData = [self sdl_getDataChunkWithSize:dataSize inputStream:inputStream];
+ NSUInteger dataSize = [[self class] sdl_getDataSizeForOffset:currentOffset fileSize:file.fileSize mtuSize:mtuSize];
+ putFile.bulkData = [[self class] sdl_getDataChunkWithSize:dataSize inputStream:inputStream];
currentOffset += dataSize;
__weak typeof(self) weakself = self;
@@ -150,7 +150,7 @@ NS_ASSUME_NONNULL_BEGIN
@param mtuSize The maximum packet size allowed
@return The the length of the data being sent in the putfile
*/
-- (NSUInteger)sdl_getPutFileLengthForOffset:(NSUInteger)currentOffset fileSize:(unsigned long long)fileSize mtuSize:(NSUInteger)mtuSize {
++ (NSUInteger)sdl_getPutFileLengthForOffset:(NSUInteger)currentOffset fileSize:(unsigned long long)fileSize mtuSize:(NSUInteger)mtuSize {
NSInteger putFileLength = 0;
if (currentOffset == 0) {
// The first putfile sends the full file size
@@ -173,7 +173,7 @@ NS_ASSUME_NONNULL_BEGIN
@param mtuSize The maximum packet size allowed
@return The size of the data to be sent in the packet.
*/
-- (NSUInteger)sdl_getDataSizeForOffset:(NSUInteger)currentOffset fileSize:(unsigned long long)fileSize mtuSize:(NSUInteger)mtuSize {
++ (NSUInteger)sdl_getDataSizeForOffset:(NSUInteger)currentOffset fileSize:(unsigned long long)fileSize mtuSize:(NSUInteger)mtuSize {
NSInteger dataSize = 0;
NSUInteger fileSizeRemaining = (NSUInteger)(fileSize - currentOffset);
if (fileSizeRemaining < mtuSize) {
@@ -191,7 +191,7 @@ NS_ASSUME_NONNULL_BEGIN
@param inputStream The socket from which to read the data
@return The data read from the socket
*/
-- (nullable NSData *)sdl_getDataChunkWithSize:(NSInteger)size inputStream:(NSInputStream *)inputStream {
++ (nullable NSData *)sdl_getDataChunkWithSize:(NSInteger)size inputStream:(NSInputStream *)inputStream {
if (size <= 0) {
return nil;
}