Java 类javax.imageio.stream.IIOByteBuffer 实例源码

项目:openjdk-jdk10    文件:MarkTryFinallyReproducer.java   
@Override
public void readBytes(IIOByteBuffer buf, int len) throws IOException {
    src.readBytes(buf, len);
}
项目:openjdk9    文件:MarkTryFinallyReproducer.java   
@Override
public void readBytes(IIOByteBuffer buf, int len) throws IOException {
    src.readBytes(buf, len);
}
项目:jmist    文件:PizCodec.java   
@Override
public void compress(IIOByteBuffer buf, Box2i range) {
  // TODO Auto-generated method stub
  throw new UnimplementedException();
}
项目:jmist    文件:PizCodec.java   
@Override
public void decompress(IIOByteBuffer buf, Box2i range) {
  // TODO Auto-generated method stub
  throw new UnimplementedException();
}
项目:jmist    文件:UnimplementedCodec.java   
@Override
public void compress(IIOByteBuffer buf, Box2i range) {
  throw new UnimplementedException("Unimplemented codec");
}
项目:jmist    文件:UnimplementedCodec.java   
@Override
public void decompress(IIOByteBuffer buf, Box2i range) {
  throw new UnimplementedException("Unimplemented codec");
}
项目:jmist    文件:FlateCodec.java   
@Override
public void compress(IIOByteBuffer buf, Box2i range) {
  try {
    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    DeflaterOutputStream inf = new DeflaterOutputStream(bytes);

    int n = buf.getLength();
    byte[] data = buf.getData();
    byte[] pred = new byte[n];

    int t1 = 0;
    int t2 = (n + 1) / 2;
    int s = buf.getOffset();
    int stop = s + n;

    while (true) {
      if (s < stop) {
        pred[t1++] = data[s++];
      } else {
        break;
      }

      if (s < stop) {
        pred[t2++] = data[s++];
      } else {
        break;
      }
    }

    int p = pred[0];
    for (int i = 1; i < n; i++) {
      int d = (int) pred[i] - p + (128 + 256);
      p = pred[i];
      pred[i] = (byte) d;
    }

    inf.write(pred);
    inf.close();
    buf.setData(bytes.toByteArray());
    buf.setOffset(0);
    buf.setLength(bytes.size());
  } catch (IOException e) {
    throw new UnexpectedException(e);
  }

}
项目:jmist    文件:IdentityCodec.java   
@Override
public void compress(IIOByteBuffer buf, Box2i range) {
  /* nothing to do. */
}
项目:jmist    文件:IdentityCodec.java   
@Override
public void decompress(IIOByteBuffer buf, Box2i range) {
  /* nothing to do. */
}
项目:jmist    文件:Codec.java   
void compress(IIOByteBuffer buf, Box2i range);
项目:jmist    文件:Codec.java   
void decompress(IIOByteBuffer buf, Box2i range);