/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* Copyright (c) 1998 International Business Machines.
* All Rights Reserved.
*
* Author : Sunanda Bera, C. Thirumalesh
* Last Modified : 11,December,1998
*
* Purpose : Defines class CharToByteISCII91.
*
*
* Revision History
* ======== =======
*
* Date By Description
* ---- -- -----------
* March 29, 1999 John Raley Removed MalformedInputException; modified substitution logic
*
*/
/**
* Converter class. Converts between ISCII91 encoding and Unicode encoding.
* ISCII91 is the character encoding as defined in Indian Standard document
* IS 13194:1991 ( Indian Script Code for Information Interchange ).
*
* @see sun.io.CharToByteConverter
*/
/*
* {jbr} I am not sure this class adheres to code converter conventions.
* Need to investigate.
* Might should recode as a subclass of CharToByteSingleByte.
*/
//private final static ISCII91 nioCoder = new ISCII91();
/**
* @return true for Devanagari and ASCII range and for the special characters
* Zero Width Joiner and Zero Width Non-Joiner
* @see sun.io.CharToByteConverter#canConvert
*
*/
//check for Devanagari range,ZWJ,ZWNJ and ASCII range.
} //canConvert()
/**
* Converts both Devanagari and ASCII range of characters.
* @see sun.io.CharToByteConverter#convert
*/
public int convert(char[] input, int inStart, int inEnd, byte[] output, int outStart, int outEnd) throws MalformedInputException, UnknownCharacterException, ConversionBufferFullException {
boolean isSurrogatePair = false;
//check if input is in ASCII RANGE
throw new ConversionBufferFullException();
}
continue;
}
// if inputChar == ZWJ replace it with halant
// if inputChar == ZWNJ replace it with Nukta
if (inputChar == 0x200c) {
}
else if (inputChar == 0x200d) {
}
}
// If input char is a high surrogate, ensure that the following
// char is a low surrogate. If not, throw a MalformedInputException.
// Leave index untouched so substitution or an UnknownCharacterException
// will result.
charOff++;
isSurrogatePair = true;
}
}
if (!isSurrogatePair) {
badInputLength = 1;
throw new MalformedInputException();
}
}
badInputLength = 1;
throw new MalformedInputException();
}
if (subMode) {
throw new ConversionBufferFullException();
}
} else {
throw new UnknownCharacterException();
}
}
else {
throw new ConversionBufferFullException();
}
throw new ConversionBufferFullException();
}
}
}
} //end for
} //end of routine convert.
/**
* @see sun.io.CharToByteConverter#flush
*/
return 0;
}//flush()
/**
* @return The character encoding as a String.
*/
return "ISCII91";
}//getCharacterEncoding
/**
* @see sun.io.CharToByteConverter#getMaxBytesPerChar
*/
public int getMaxBytesPerChar() {
return 2;
}//getMaxBytesPerChar()
/**
* @see sun.io.CharToByteConverter#reset
*/
public void reset() {
}
} //end of class definition