RLEBitInputStream rlis=new RLEBitInputStream(mhis);
if((width&0x0007)==0){
byte[] buf=new byte[width>>3];int len=0;
while(true){
rlis.resetToStartCodeWord(); // start next line with white
try{
len=rlis.read(buf); // read one image line
if(len==-1){break;} // end of page
System.arraycopy(buf,0,imgdata,off,len); // copy line to image buffer
mhis.skipPadding(8); // skip bits up until next byte boundary