public TextConversionStream(int inputStyle, int outputStyle, OutputStream out) {

            super(out);

            switch (inputStyle) {
                    case TEXT_CRLF: {
                             stripCR = false;
                             stripLF = false;
                             stripCRLF = true;
                    } break;
                    case TEXT_CR: {
                             stripCR = true;
                             stripLF = false;
                             stripCRLF = false;
                    } break;
                    case TEXT_LF: {
                             stripCR = false;
                             stripLF = true;
                             stripCRLF = false;
                    } break;
                    case TEXT_ALL: {
                        stripCR = true;
                        stripLF = true;
                        stripCRLF = true;
                    } break;
                    default: {
                            throw new IllegalArgumentException("Unknown text style: " + outputStyle);
                    }
            }


            switch (outputStyle) {
                    case TEXT_SYSTEM: {
                             lineEnding = systemNL.getBytes();
                    } break;
                    case TEXT_CRLF: {
                             lineEnding = new byte[]{(byte)'\r',(byte)'\n'};
                    } break;
                    case TEXT_CR: {
                             lineEnding = new byte[]{(byte)'\r'};
                    } break;
                    case TEXT_LF: {
                             lineEnding = new byte[]{(byte)'\n'};
                    } break;
                    case TEXT_ALL: {
                        throw new IllegalArgumentException("TEXT_ALL cannot be used for an output style");
                    }
                    default: {
                            throw new IllegalArgumentException("Unknown text style: " + outputStyle);
                    }
            }
        }