mirror of
https://github.com/GLEGram/GLEGram-iOS.git
synced 2026-04-24 11:56:18 +02:00
4647310322
Based on Swiftgram 12.5 (Telegram iOS 12.5). All GLEGram features ported and organized in GLEGram/ folder. Features: Ghost Mode, Saved Deleted Messages, Content Protection Bypass, Font Replacement, Fake Profile, Chat Export, Plugin System, and more. See CHANGELOG_12.5.md for full details.
72 lines
962 B
Objective-C
72 lines
962 B
Objective-C
#import <LegacyComponents/TGDataResource.h>
|
|
|
|
@interface TGDataResource ()
|
|
{
|
|
NSData *_data;
|
|
NSInputStream *_stream;
|
|
UIImage *_image;
|
|
bool _imageDecoded;
|
|
}
|
|
|
|
@end
|
|
|
|
@implementation TGDataResource
|
|
|
|
- (instancetype)initWithData:(NSData *)data
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
_data = data;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (instancetype)initWithInputStream:(NSInputStream *)stream
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
_stream = stream;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (instancetype)initWithImage:(UIImage *)image decoded:(bool)decoded
|
|
{
|
|
self = [super init];
|
|
if (self != nil)
|
|
{
|
|
_image = image;
|
|
_imageDecoded = decoded;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (void)dealloc
|
|
{
|
|
[_stream close];
|
|
}
|
|
|
|
- (NSData *)data
|
|
{
|
|
return _data;
|
|
}
|
|
|
|
- (NSInputStream *)stream
|
|
{
|
|
return _stream;
|
|
}
|
|
|
|
- (UIImage *)image
|
|
{
|
|
return _image;
|
|
}
|
|
|
|
- (bool)isImageDecoded
|
|
{
|
|
return _imageDecoded;
|
|
}
|
|
|
|
@end
|