com.jcraft.jzlib.GZIPOutputStream.write()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中com.jcraft.jzlib.GZIPOutputStream.write()方法的一些代码示例,展示了GZIPOutputStream.write()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GZIPOutputStream.write()方法的具体详情如下:
包路径:com.jcraft.jzlib.GZIPOutputStream
类名称:GZIPOutputStream
方法名:write

GZIPOutputStream.write介绍

暂无

代码示例

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "putc", required = 1)
public IRubyObject putc(IRubyObject p1) {
  try {
    io.write(RubyNumeric.num2chr(p1));
    
    return p1;
  } catch (IOException ioe) {
    throw getRuntime().newIOErrorFromException(ioe);
  }
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "putc", required = 1)
public IRubyObject putc(IRubyObject p1) {
  try {
    io.write(RubyNumeric.num2chr(p1));
    
    return p1;
  } catch (IOException ioe) {
    throw getRuntime().newIOErrorFromException(ioe);
  }
}

代码示例来源:origin: org.jruby/jruby-core

@JRubyMethod(name = "putc", required = 1)
public IRubyObject putc(IRubyObject p1) {
  try {
    io.write(RubyNumeric.num2chr(p1));
    
    return p1;
  } catch (IOException ioe) {
    throw getRuntime().newIOErrorFromException(ioe);
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "putc", required = 1)
public IRubyObject putc(IRubyObject p1) {
  try {
    io.write(RubyNumeric.num2chr(p1));
    
    return p1;
  } catch (IOException ioe) {
    throw getRuntime().newIOErrorFromException(ioe);
  }
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "write", required = 1)
public IRubyObject write(IRubyObject p1) {
  Ruby runtime = getRuntime();
  ByteList bytes = p1.asString().getByteList();
  
  if (runtime.is1_9()) {
    if (enc2 != null
        && enc2 != ASCIIEncoding.INSTANCE) {
      bytes = Transcoder.strConvEncOpts(runtime.getCurrentContext(), bytes, bytes.getEncoding(),
          enc2, 0, runtime.getNil());
    }
  }
  
  try {
    // TODO: jzlib-1.1.0.jar throws IndexOutOfBoundException for zero length buffer.
    if (bytes.length() > 0) {
      io.write(bytes.getUnsafeBytes(), bytes.begin(), bytes.length());
    }
    
    return runtime.newFixnum(bytes.length());
  } catch (IOException ioe) {
    throw runtime.newIOErrorFromException(ioe);
  }
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@JRubyMethod(name = "write", required = 1)
public IRubyObject write(IRubyObject p1) {
  Ruby runtime = getRuntime();
  ByteList bytes = p1.asString().getByteList();
  
  if (runtime.is1_9()) {
    if (enc2 != null
        && enc2 != ASCIIEncoding.INSTANCE) {
      bytes = Transcoder.strConvEncOpts(runtime.getCurrentContext(), bytes, bytes.getEncoding(),
          enc2, 0, runtime.getNil());
    }
  }
  
  try {
    // TODO: jzlib-1.1.0.jar throws IndexOutOfBoundException for zero length buffer.
    if (bytes.length() > 0) {
      io.write(bytes.getUnsafeBytes(), bytes.begin(), bytes.length());
    }
    
    return runtime.newFixnum(bytes.length());
  } catch (IOException ioe) {
    throw runtime.newIOErrorFromException(ioe);
  }
}

代码示例来源:origin: org.jruby/jruby-complete

@JRubyMethod(name = "write", required = 1)
public IRubyObject write(IRubyObject p1) {
  Ruby runtime = getRuntime();
  RubyString str = p1.asString();
  if (enc2 != null
      && enc2 != ASCIIEncoding.INSTANCE) {
    str = EncodingUtils.strConvEncOpts(runtime.getCurrentContext(), str, str.getEncoding(),
        enc2, 0, runtime.getNil());
  
  }
  
  try {
    // TODO: jzlib-1.1.0.jar throws IndexOutOfBoundException for zero length buffer.
    if (str.size() > 0) {
      io.write(str.getByteList().getUnsafeBytes(), str.getByteList().begin(), str.getByteList().length());
    }
    
    return runtime.newFixnum(str.getByteList().length());
  } catch (IOException ioe) {
    throw runtime.newIOErrorFromException(ioe);
  }
}

代码示例来源:origin: org.jruby/jruby-core

@JRubyMethod(name = "write", required = 1)
public IRubyObject write(IRubyObject p1) {
  Ruby runtime = getRuntime();
  RubyString str = p1.asString();
  if (enc2 != null
      && enc2 != ASCIIEncoding.INSTANCE) {
    str = EncodingUtils.strConvEncOpts(runtime.getCurrentContext(), str, str.getEncoding(),
        enc2, 0, runtime.getNil());
  
  }
  
  try {
    // TODO: jzlib-1.1.0.jar throws IndexOutOfBoundException for zero length buffer.
    if (str.size() > 0) {
      io.write(str.getByteList().getUnsafeBytes(), str.getByteList().begin(), str.getByteList().length());
    }
    
    return runtime.newFixnum(str.getByteList().length());
  } catch (IOException ioe) {
    throw runtime.newIOErrorFromException(ioe);
  }
}

相关文章