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 6820351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:24:52+00:00 2026-05-26T21:24:52+00:00

I have encrypted video file and while decrypting it i have defined Byte byte[]

  • 0

I have encrypted video file and while decrypting it i have defined Bytebyte[] input = new byte[1024]; size to written it in output file.
Here i want to write first 1024 bytes in output files while at same time if want to play that video file i can play that output file without waiting to whole file written like video streaming.

when first 1024 bytes written , video file will start playing till whole file will written.

  • 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-05-26T21:24:53+00:00Added an answer on May 26, 2026 at 9:24 pm

    You’ll have to setup your input stream and output stream depending on where you’re getting the data and where you’re saving/viewing it. Performance could also likely be improved with some buffering on the output. You should get the general idea.

    public class DecryptionWotsit {
        private final BlockingDeque<Byte> queue = new LinkedBlockingDeque<Byte>();
        private final InputStream in;
        private final OutputStream out;
        public DecryptionWotsit(InputStream in, OutputStream out) {
            this.in = in;
            this.out = out;
        }
    
        public void go() {
            final Runnable decryptionTask = new Runnable() {
                @Override
                public void run() {
                    try {
                        byte[] encrypted = new byte[1024];
                        byte[] decrypted = new byte[1024];
                        while (true) {
                            int encryptedBytes = in.read(encrypted);
    
                            // TODO: decrypt into decrypted, set decryptedBytes
                            int decryptedBytes = 0;
    
                            for (int i = 0; i < decryptedBytes; i++)
                                queue.addFirst(decrypted[i]);
                        }
                    }
                    catch (Exception e) {
                        // exception handling left for the reader
                        throw new RuntimeException(e);
                    }
                }
            };
            final Runnable playTask = new Runnable() {
                @Override
                public void run() {
                    try {
                        while (true) {
                            out.write(queue.takeLast());
                        }
                    }
                    catch (Exception e) {
                        throw new RuntimeException(e);
                    }
                }
            };
            Executors.newSingleThreadExecutor().execute(decryptionTask);
            Executors.newSingleThreadExecutor().execute(playTask);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have an encrypted file on an iPhone and every time I
I have a pgp-encrypted file that I need to extract data from at runtime.
I have an encrypted word/excel/pdf file locally stored which I need to preview in
I have a file encrypted with java application using AES. I also have a
Let me explain what I'm trying to realize: I have a encrypted tar file.
I have a DirectShow graph, contains file source filter, splitter filter, decoders for video
I have a Video file of 700 mb, For security reason, I want to
I have an encrypted XML file that needs to be decrypted and displayed in
I have encrypted every item in MS Access file using AES. Encryption works great.
if i have both encrypted message and signature (let's say two different size files),

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.