Add stream avail() methods
Makes it more readable to write code that needs to know how much data/space is available in a stream.
This commit is contained in:
committed by
Lauri Kasanen
parent
910fd8fa3e
commit
7f90205cf2
@@ -85,7 +85,7 @@ JpegInitDestination(j_compress_ptr cinfo)
|
||||
|
||||
jc->clear();
|
||||
dest->pub.next_output_byte = jc->getptr();
|
||||
dest->pub.free_in_buffer = jc->getend() - jc->getptr();
|
||||
dest->pub.free_in_buffer = jc->avail();
|
||||
}
|
||||
|
||||
static boolean
|
||||
@@ -97,7 +97,7 @@ JpegEmptyOutputBuffer(j_compress_ptr cinfo)
|
||||
jc->setptr(jc->getend());
|
||||
jc->overrun(jc->getend() - jc->getstart(), 1);
|
||||
dest->pub.next_output_byte = jc->getptr();
|
||||
dest->pub.free_in_buffer = jc->getend() - jc->getptr();
|
||||
dest->pub.free_in_buffer = jc->avail();
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user