git://git.nikiroo.be
/
nikiroo-utils.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
New: BufferedOutputStream
[nikiroo-utils.git]
/
src
/
be
/
nikiroo
/
utils
/
NextableInputStream.java
diff --git
a/src/be/nikiroo/utils/NextableInputStream.java
b/src/be/nikiroo/utils/NextableInputStream.java
index 7e2766ad950d6f10efa0dbd5c16214ebcb581605..f221cbbda9aa2ce9ad0eff7f215c725cbc886ab0 100644
(file)
--- a/
src/be/nikiroo/utils/NextableInputStream.java
+++ b/
src/be/nikiroo/utils/NextableInputStream.java
@@
-142,7
+142,7
@@
public class NextableInputStream extends BufferedInputStream {
return bufferChanged;
}
return bufferChanged;
}
- if (
pos >= len
) {
+ if (
start >= stop
) {
eof = true;
}
eof = true;
}
@@
-161,9
+161,9
@@
public class NextableInputStream extends BufferedInputStream {
/**
* Check that the buffer didn't overshot to the next item, and fix
/**
* Check that the buffer didn't overshot to the next item, and fix
- * {@link NextableInputStream#
len
} if needed.
+ * {@link NextableInputStream#
stop
} if needed.
* <p>
* <p>
- * If {@link NextableInputStream#
len
} is fixed,
+ * If {@link NextableInputStream#
stop
} is fixed,
* {@link NextableInputStream#eof} and {@link NextableInputStream#stopped}
* are set to TRUE.
*
* {@link NextableInputStream#eof} and {@link NextableInputStream#stopped}
* are set to TRUE.
*
@@
-172,14
+172,14
@@
public class NextableInputStream extends BufferedInputStream {
* the {@link NextableInputStreamStep}
*/
private void checkBuffer(boolean newBuffer) {
* the {@link NextableInputStreamStep}
*/
private void checkBuffer(boolean newBuffer) {
- if (step != null &&
len
> 0) {
+ if (step != null &&
stop
> 0) {
if (newBuffer) {
step.clearBuffer();
}
if (newBuffer) {
step.clearBuffer();
}
- int stopAt = step.stop(buffer,
pos, len
);
+ int stopAt = step.stop(buffer,
start, stop
);
if (stopAt >= 0) {
if (stopAt >= 0) {
-
len
= stopAt;
+
stop
= stopAt;
eof = true;
stopped = true;
}
eof = true;
stopped = true;
}
@@
-214,8
+214,8
@@
public class NextableInputStream extends BufferedInputStream {
}
if (step != null && !hasMoreData() && stopped) {
}
if (step != null && !hasMoreData() && stopped) {
-
len
= step.getResumeLen();
-
pos
+= step.getResumeSkip();
+
stop
= step.getResumeLen();
+
start
+= step.getResumeSkip();
eof = false;
if (all) {
eof = false;
if (all) {