Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decodeBuffer have some problem #5

Open
hujiudeyang opened this issue Mar 27, 2017 · 0 comments
Open

decodeBuffer have some problem #5

hujiudeyang opened this issue Mar 27, 2017 · 0 comments

Comments

@hujiudeyang
Copy link

I want to write an output encrypted file
but wo have a question
decodeBuffer(InputStream aStream, OutputStream bStream) will Infinite loop.

public void decodeBuffer(InputStream aStream, OutputStream bStream) throws IOException {
        int totalBytes = 0;
        PushbackInputStream ps = new PushbackInputStream(aStream);
        this.decodeBufferPrefix(ps, bStream);

        while(true) {
            try {
                int length = this.decodeLinePrefix(ps, bStream);

                int i;
                for(i = 0; i + this.bytesPerAtom() < length; i += this.bytesPerAtom()) {
                    this.decodeAtom(ps, bStream, this.bytesPerAtom());
                    totalBytes += this.bytesPerAtom();
                }

                if(i + this.bytesPerAtom() == length) {
                    this.decodeAtom(ps, bStream, this.bytesPerAtom());
                    totalBytes += this.bytesPerAtom();
                } else {
                    this.decodeAtom(ps, bStream, length - i);
                    totalBytes += length - i;
                }

                this.decodeLineSuffix(ps, bStream);
            } catch (CEStreamExhausted var8) {
                this.decodeBufferSuffix(ps, bStream);
                return;
            }
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant