7374757677787980818283
{ mcios.writeBits(image.getRGB(x, y) & 0xFF, bpc); } while (mcios.getBitOffset() != 0) { mcios.writeBit(0); } } mcios.flush(); mcios.close(); }
149150151152153154155156157158159
MemoryCacheImageOutputStream mcios = new MemoryCacheImageOutputStream(bos); int width = alphaRaster.getSampleModel().getWidth(); int p = 0; for (int pixel : pixels) { mcios.writeBit(pixel); ++p; if (p % width == 0) { while (mcios.getBitOffset() != 0) {
155156157158159160161162163164165
++p; if (p % width == 0) { while (mcios.getBitOffset() != 0) { mcios.writeBit(0); } } } mcios.flush(); mcios.close();
174175176177178179180181182183184
} } // padding while (mcios.getBitOffset() != 0) { mcios.writeBit(0); } mcios.flush(); mcios.close(); } else