private IRubyObject initializeCommon(IRubyObject stream, int level) {
realIo = (RubyObject) stream;
try {
// the 15+16 here is copied from a Deflater default constructor
Deflater deflater = new Deflater(level, 15+16, false);
io = new GZIPOutputStream(new IOOutputStream(realIo, false, false), deflater, 512, false);
return this;
} catch (IOException ioe) {
throw getRuntime().newIOErrorFromException(ioe);
}
}