Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8576313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:53:52+00:00 2026-06-11T19:53:52+00:00

I read the docs, googled around, but still cannot figure how to read a

  • 0

I read the docs, googled around, but still cannot figure how to read a blob as a byte array.

I’m able to generate PDF files and store them in the blobstore. I can also serve these blobs for download using serve(), no problems. All this is working fine.

Now I want to retrieve one of these blobs, and read it as a byte array to pass it to the Mail API, for sending as Mime attachment. The Mail API accepts only byte arrays as attachment data, as I understood.

I saw the read() method of the BufferedInputStream, but it proposes to fetch n bytes. I need to read the full blob at once. I don’t know its length before reading it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:53:53+00:00Added an answer on June 11, 2026 at 7:53 pm

    Like this:

    byte[] myFile = blobstoreService.fetchData(blobKey, index, index + batchSize);
    

    Basically you start at index=0 and you loop through this blob until you get an array which is shorter than your batch size.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've read some docs about the .NET Garbage Collector but i still have some
I've read through the docs but still can't see how to target individual cells
i read docs http://docs.jquery.com/Plugins/Treeview/treeview#options also googled, but nothing found easy and good solution, how
I have read the docs and everything but I'm very confused. I never needed
I read lot's of docs, tried everything and still can't understand why my template
I've read much of the MySQL Cluster docs and some tutorials yet I still
I've googled around and searched the MYSQL docs ad nauseam and couldn't find a
I've read the Google docs on sitemap formats but there's one thing they don't
I have read all the docs I can get my hands on and google'd
as someone's who's just starting to get into Android/Java programming, I've read the docs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.