[#13] Change GetObject result to stream #12
1 changed files with 1 additions and 23 deletions
|
@ -310,7 +310,6 @@ internal class ObjectServiceProvider : ContextAccessor
|
|||
return ObjectId.FromHash(response.Body.ObjectId.Value.ToByteArray());
|
||||
}
|
||||
|
||||
// TODO: add implementation with stream writer!
|
||||
private async Task<ModelsV2.Object> GetObject(GetRequest request, Context ctx)
|
||||
{
|
||||
var reader = GetObjectInit(request, ctx);
|
||||
|
@ -321,28 +320,7 @@ internal class ObjectServiceProvider : ContextAccessor
|
|||
|
||||
@object.ObjectReader = reader;
|
||||
|
||||
return @object;
|
||||
|
||||
// obj.
|
||||
|
||||
// return obj.ToModel();
|
||||
|
||||
// var payload = new byte[obj.Header.PayloadLength];
|
||||
// var offset = 0L;
|
||||
// var chunk = await stream.ReadChunk();
|
||||
|
||||
// while (chunk is not null && (ulong)offset < obj.Header.PayloadLength)
|
||||
// {
|
||||
// var length = Math.Min((long)obj.Header.PayloadLength - offset, chunk.Length);
|
||||
|
||||
// Array.Copy(chunk, 0, payload, offset, length);
|
||||
// offset += chunk.Length;
|
||||
// chunk = await stream.ReadChunk();
|
||||
// }
|
||||
|
||||
// obj.Payload = ByteString.CopyFrom(payload);
|
||||
|
||||
// return obj;
|
||||
return @object;
|
||||
}
|
||||
|
||||
private ObjectReader GetObjectInit(GetRequest initRequest, Context ctx)
|
||||
|
|
Loading…
Reference in a new issue