Skip to content
This repository was archived by the owner on May 6, 2025. It is now read-only.
This repository was archived by the owner on May 6, 2025. It is now read-only.

Bad implementation for android Package.getInputStream().skip(long byteCount) #103

@ClementHard

Description

@ClementHard

The implementation for the InputStream skip method should skip from the current position instead of skipping from the beginning (skip != seek).

InputStream is = mPackage.getInputStream(uri);
Log.d("tag", String.valueOf(dis.read())); // 1
Log.d("tag", String.valueOf(dis.read())); // 2
Log.d("tag", String.valueOf(dis.read())); // 3
Log.d("tag", String.valueOf(dis.read())); // 4

InputStream is = mPackage.getInputStream(uri);
Log.d("tag", String.valueOf(dis.read())); // 1
Log.d("tag", String.valueOf(dis.read())); // 2
Log.d("tag", String.valueOf(dis.skip(1))); 
Log.d("tag", String.valueOf(dis.read())); // 2 but should be 4
Log.d("tag", String.valueOf(dis.read())); // 3 but should be 5

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions