@Override
    public void writeImage(final BufferedImage src, final OutputStream os, final PcxImagingParameters params) throws ImagingException, IOException {
        final int headerSize = 4 + 1024 * 4;

        @SuppressWarnings("resource") // Caller closes 'os'.
        final AbstractBinaryOutputStream bos = AbstractBinaryOutputStream.littleEndian(os);
        bos.write4Bytes(DcxHeader.DCX_ID);
        // Some apps may need a full 1024 entry table
        bos.write4Bytes(headerSize);
        for (int i = 0; i < 1023; i++) {
            bos.write4Bytes(0);
        }
        new PcxImageParser().writeImage(src, bos, params);
    }
Constructs a new instance with the little-endian byte order.
src/main/java/org/apache/commons/imaging/formats/dcx/DcxImageParser.java