Actually, I require
A valid Base64 string value that identifies the block. Prior to encoding, the string must be less than or equal to 64 bytes in size.
For a given blob, the length of the value specified for the blockid parameter must be the same size for each block.
Note that the Base64 string must be URL-encoded.
as stated in https://learn.microsoft.com/en-us/rest/api/storageservices/fileservices/put-block.
For that, I am converting some C# code to Java. And I am having problem with this line of code
//create a blockID from the block number, add it to the block ID list
//the block ID is a base64 string
String blockId = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(string.Format("BlockId{0}",blockNumber.ToString("0000000"))));
I have tried below:
String str = "BlockId"+blockNumber;
String blockId = Base64.getEncoder().encodeToString(("BlockId"+(blockNumber+"")).getBytes("utf-8"));
But, I am not able to understand what "0000000" as a argument to ToString doing and what is its equivalent in Java.
And also how can I fulfil the second condition that length of blockid of each block or chance file should be same in JAVA. As file size can vary.