Merge commit '7621e2f8dec938cf48181c8b10afc9b01f444e68' into beta

This commit is contained in:
Ilya Laktyushin
2025-12-06 02:17:48 +04:00
commit 8344b97e03
28070 changed files with 7995182 additions and 0 deletions
@@ -0,0 +1,71 @@
#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