com.jcraft.jzlib.ZStreamException.<init>()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(109)

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

ZStreamException.<init>介绍

暂无

代码示例

代码示例来源:origin: google/sagetv

public void write(byte b[], int off, int len) throws IOException {
 if(len==0)
  return;
 int err;
 z.next_in=b;
 z.next_in_index=off;
 z.avail_in=len;
 do{
  z.next_out=buf;
  z.next_out_index=0;
  z.avail_out=bufsize;
  if(compress)
   err=z.deflate(flush);
  else
   err=z.inflate(flush);
  if(err!=JZlib.Z_OK)
   throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
  out.write(buf, 0, bufsize-z.avail_out);
 } 
 while(z.avail_in>0 || z.avail_out==0);
}

代码示例来源:origin: com.jcraft.jzlib/com.springsource.com.jcraft.jzlib

public void write(byte b[], int off, int len) throws IOException {
 if(len==0)
  return;
 int err;
 z.next_in=b;
 z.next_in_index=off;
 z.avail_in=len;
 do{
  z.next_out=buf;
  z.next_out_index=0;
  z.avail_out=bufsize;
  if(compress)
   err=z.deflate(flush);
  else
   err=z.inflate(flush);
  if(err!=JZlib.Z_OK)
   throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
  out.write(buf, 0, bufsize-z.avail_out);
 } 
 while(z.avail_in>0 || z.avail_out==0);
}

代码示例来源:origin: jzlib/jzlib

public void write(byte b[], int off, int len) throws IOException {
 if(len==0)
  return;
 int err;
 z.next_in=b;
 z.next_in_index=off;
 z.avail_in=len;
 do{
  z.next_out=buf;
  z.next_out_index=0;
  z.avail_out=bufsize;
  if(compress)
   err=z.deflate(flush);
  else
   err=z.inflate(flush);
  if(err!=JZlib.Z_OK)
   throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
  out.write(buf, 0, bufsize-z.avail_out);
 } 
 while(z.avail_in>0 || z.avail_out==0);
}

代码示例来源:origin: google/sagetv

return(-1);
 if(err!=JZlib.Z_OK && err!=JZlib.Z_STREAM_END)
throw new ZStreamException((compress ? "de" : "in")+"flating: "+z.msg);
 if((nomoreinput||err==JZlib.Z_STREAM_END)&&(z.avail_out==len))
return(-1);

代码示例来源:origin: com.jcraft.jzlib/com.springsource.com.jcraft.jzlib

return(-1);
 if(err!=JZlib.Z_OK && err!=JZlib.Z_STREAM_END)
throw new ZStreamException((compress ? "de" : "in")+"flating: "+z.msg);
 if((nomoreinput||err==JZlib.Z_STREAM_END)&&(z.avail_out==len))
return(-1);

代码示例来源:origin: jzlib/jzlib

return(-1);
 if(err!=JZlib.Z_OK && err!=JZlib.Z_STREAM_END)
throw new ZStreamException((compress ? "de" : "in")+"flating: "+z.msg);
 if(nomoreinput&&(z.avail_out==len))
return(-1);

代码示例来源:origin: com.jcraft.jzlib/com.springsource.com.jcraft.jzlib

public void finish() throws IOException {
 int err;
 do{
  z.next_out=buf;
  z.next_out_index=0;
  z.avail_out=bufsize;
  if(compress){ err=z.deflate(JZlib.Z_FINISH);  }
  else{ err=z.inflate(JZlib.Z_FINISH); }
  if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK)
  throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
  if(bufsize-z.avail_out>0){
 out.write(buf, 0, bufsize-z.avail_out);
  }
 }
 while(z.avail_in>0 || z.avail_out==0);
 flush();
}
public void end() {

代码示例来源:origin: google/sagetv

public void finish() throws IOException {
 int err;
 do{
  z.next_out=buf;
  z.next_out_index=0;
  z.avail_out=bufsize;
  if(compress){ err=z.deflate(JZlib.Z_FINISH);  }
  else{ err=z.inflate(JZlib.Z_FINISH); }
  if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK)
  throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
  if(bufsize-z.avail_out>0){
 out.write(buf, 0, bufsize-z.avail_out);
  }
 }
 while(z.avail_in>0 || z.avail_out==0);
 flush();
}
public void end() {

代码示例来源:origin: jzlib/jzlib

public void finish() throws IOException {
 int err;
 do{
  z.next_out=buf;
  z.next_out_index=0;
  z.avail_out=bufsize;
  if(compress){ err=z.deflate(JZlib.Z_FINISH);  }
  else{ err=z.inflate(JZlib.Z_FINISH); }
  if(err!=JZlib.Z_STREAM_END && err != JZlib.Z_OK)
  throw new ZStreamException((compress?"de":"in")+"flating: "+z.msg);
  if(bufsize-z.avail_out>0){
 out.write(buf, 0, bufsize-z.avail_out);
  }
 }
 while(z.avail_in>0 || z.avail_out==0);
 try { flush(); } 
 catch (IOException ignored) {
 }
}
public void end() throws IOException {

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jzlib

public int read(byte[] b, int off, int len) throws IOException {
 if(compress){
  deflater.setOutput(b, off, len);
  while(true){
   int datalen = in.read(buf, 0, buf.length);
   if(datalen == -1) return -1;
   deflater.setInput(buf, 0, datalen, true);
   int err = deflater.deflate(flush);
   if(deflater.next_out_index>0)
    return deflater.next_out_index;
   if(err == JZlib.Z_STREAM_END)
    return 0;
   if(err == JZlib.Z_STREAM_ERROR ||
     err == JZlib.Z_DATA_ERROR){
    throw new ZStreamException("deflating: "+deflater.msg);
   }
  }
 }
 else{
  return iis.read(b, off, len); 
 }
}

代码示例来源:origin: ymnk/jzlib

public int read(byte[] b, int off, int len) throws IOException {
 if(compress){
  deflater.setOutput(b, off, len);
  while(true){
   int datalen = in.read(buf, 0, buf.length);
   if(datalen == -1) return -1;
   deflater.setInput(buf, 0, datalen, true);
   int err = deflater.deflate(flush);
   if(deflater.next_out_index>0)
    return deflater.next_out_index;
   if(err == JZlib.Z_STREAM_END)
    return 0;
   if(err == JZlib.Z_STREAM_ERROR ||
     err == JZlib.Z_DATA_ERROR){
    throw new ZStreamException("deflating: "+deflater.msg);
   }
  }
 }
 else{
  return iis.read(b, off, len); 
 }
}

代码示例来源:origin: com.jcraft/jzlib

public void write(byte b[], int off, int len) throws IOException {
 if(len==0) return;
 if(compress){
  dos.write(b, off, len);
 }
 else {
  inflater.setInput(b, off, len, true);
  int err = JZlib.Z_OK;
  while(inflater.avail_in>0){
   inflater.setOutput(buf, 0, buf.length);
   err = inflater.inflate(flush);
   if(inflater.next_out_index>0)
    out.write(buf, 0, inflater.next_out_index);
   if(err != JZlib.Z_OK)
    break;
  }
  if(err != JZlib.Z_OK)
   throw new ZStreamException("inflating: "+inflater.msg);
  return;
 }
}

代码示例来源:origin: com.jcraft/jzlib

public int read(byte[] b, int off, int len) throws IOException {
 if(compress){
  deflater.setOutput(b, off, len);
  while(true){
   int datalen = in.read(buf, 0, buf.length);
   if(datalen == -1) return -1;
   deflater.setInput(buf, 0, datalen, true);
   int err = deflater.deflate(flush);
   if(deflater.next_out_index>0)
    return deflater.next_out_index;
   if(err == JZlib.Z_STREAM_END)
    return 0;
   if(err == JZlib.Z_STREAM_ERROR ||
     err == JZlib.Z_DATA_ERROR){
    throw new ZStreamException("deflating: "+deflater.msg);
   }
  }
 }
 else{
  return iis.read(b, off, len); 
 }
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.jzlib

public void write(byte b[], int off, int len) throws IOException {
 if(len==0) return;
 if(compress){
  dos.write(b, off, len);
 }
 else {
  inflater.setInput(b, off, len, true);
  int err = JZlib.Z_OK;
  while(inflater.avail_in>0){
   inflater.setOutput(buf, 0, buf.length);
   err = inflater.inflate(flush);
   if(inflater.next_out_index>0)
    out.write(buf, 0, inflater.next_out_index);
   if(err != JZlib.Z_OK)
    break;
  }
  if(err != JZlib.Z_OK)
   throw new ZStreamException("inflating: "+inflater.msg);
  return;
 }
}

代码示例来源:origin: ymnk/jzlib

public void write(byte b[], int off, int len) throws IOException {
 if(len==0) return;
 if(compress){
  dos.write(b, off, len);
 }
 else {
  inflater.setInput(b, off, len, true);
  int err = JZlib.Z_OK;
  while(inflater.avail_in>0){
   inflater.setOutput(buf, 0, buf.length);
   err = inflater.inflate(flush);
   if(inflater.next_out_index>0)
    out.write(buf, 0, inflater.next_out_index);
   if(err != JZlib.Z_OK)
    break;
  }
  if(err != JZlib.Z_OK)
   throw new ZStreamException("inflating: "+inflater.msg);
  return;
 }
}

相关文章

ZStreamException类方法