/*
* 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.
*/
/*
*/
/**
* An abstract base class for subclasses which decode
* IBM double byte ebcdic host encodings such as ibm code
* pages 933, 935, 937,... etc
*
*/
{
protected short index1[];
protected int mask1;
protected int mask2;
protected int shift;
private int currentState;
}
protected void implReset() {
currentState = SBCS;
}
try {
int inputSize = 1;
int v = 0;
char outputChar = REPLACE_CHAR;
if (b1 < 0)
b1 += 256;
// For SO characters - simply validate the state and if OK
// update the state and go to the next byte
if (currentState != SBCS)
else
currentState = DBCS;
// For SI characters - simply validate the state and if OK
// update the state and go to the next byte
if (currentState != DBCS) {
} else {
currentState = SBCS;
}
} else {
if (currentState == SBCS) {
} else {
return CoderResult.UNDERFLOW;
if (b2 < 0)
b2 += 256;
inputSize++;
// Check validity of dbcs ebcdic byte pair values
}
// Lookup in the two level index
+ (v & mask2));
}
if (outputChar == '\uFFFD')
return CoderResult.OVERFLOW;
}
}
return CoderResult.UNDERFLOW;
} finally {
}
}
try {
while (src.hasRemaining()) {
int v = 0;
int inputSize = 1;
char outputChar = REPLACE_CHAR;
if (b1 < 0)
b1 += 256;
// For SO characters - simply validate the state and if OK
// update the state and go to the next byte
if (currentState != SBCS)
else
currentState = DBCS;
// For SI characters - simply validate the state and if OK
// update the state and go to the next byte
if (currentState != DBCS) {
} else {
currentState = SBCS;
}
} else {
if (currentState == SBCS) {
} else {
return CoderResult.UNDERFLOW;
if (b2 < 0)
b2 += 256;
inputSize++;
// Check validity of dbcs ebcdic byte pair values
}
// Lookup in the two level index
+ (v & mask2));
}
if (outputChar == REPLACE_CHAR)
if (!dst.hasRemaining())
return CoderResult.OVERFLOW;
}
}
return CoderResult.UNDERFLOW;
} finally {
}
}
else
}
}