Getting objects
To retrieve an object, you need to know its ID as well as the ID of the container where it is stored.
The result will be presented as sequential chunks received in response to the request until the entire object has been read.
Arguments:
Execution context
Method arguments, which includes:
Container ID
Object ID
Additional headers (optional)
Result:
Golang Java C#
func GetObject ( ctx context . Context , p pool . Pool , addr oid . Address ) string {
var prm pool . PrmObjectGet
prm . SetAddress ( addr )
res , err := p . GetObject ( ctx , prm )
die ( err )
payload , err := io . ReadAll ( res . Payload )
die ( err )
return string ( payload )
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 public static void getObject ( FrostFSClient frostFSClient , ContainerId containerId , ObjectId objectId ,
CallContext callContext ) {
var prmObjectGet = new PrmObjectGet ( containerId , objectId );
ObjectFrostFS object = frostFSClient . getObject ( prmObjectGet , callContext );
var reader = object . getObjectReader ();
var chunk = reader . readChunk ();
var length = chunk . length ;
byte [] buffer = null ;
while ( length > 0 ) {
buffer = isNull ( buffer ) ? chunk : ArrayHelper . concat ( buffer , chunk );
chunk = object . getObjectReader (). readChunk ();
length = ArrayUtils . isEmpty ( chunk ) ? 0 : chunk . length ;
}
}
public static async Task < FrostFsObject > GetObjectAsync (
FrostFSClient client ,
FrostFsContainerId containerId ,
FrostFsObjectId objectId )
{
var args = new PrmObjectGet ( containerId , objectId );
return await client . GetObjectAsync ( args , default );
}
October 20, 2025
October 17, 2025