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

Broken VirtualRoot.Entry.outputStream() #639

Closed
DavePearce opened this issue Apr 24, 2016 · 0 comments
Closed

Broken VirtualRoot.Entry.outputStream() #639

DavePearce opened this issue Apr 24, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@DavePearce
Copy link
Member

The following method in wyfs.util.VirtualRoot.Entry is broken:

public OutputStream outputStream() {
            lastModified = System.currentTimeMillis();
            data = new byte[0];
            // create an output stream which will automatically resize the given
            // array.
            return new OutputStream() {
                private int pos = 0;

                public void write(int b) {
                    if (pos >= data.length) {
                        data = Arrays.copyOf(data, (data.length + 1) * 2);
                    }
                    data[pos++] = (byte) b;
                }
            };
        }

It's broken because it leaves empty bytes at the end of final array.

@DavePearce DavePearce self-assigned this Apr 24, 2016
@DavePearce DavePearce added this to the ChangeList Pre v0.4.0 milestone Apr 24, 2016
DavePearce added a commit that referenced this issue Apr 24, 2016
This was a simple problem related to the way that VirtualRool was
handling outputstreams for its contained Entry's.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant