Since you're not actually using output
inside the method besides to call the method itself, I assume you're really trying to call output.write(int)
and not have the method call itself;
for(int i = 0; i < bufUsageBytes; i++){
// will call the method you're already in, probably not intended
// write(output, ((int) (buffer & 255)));
// will call write on the outputstream, probably what you're intending
output.write((int) (buffer & 255));
buffer >>= 8;
}