/*
* 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.
*
* THIS FILE WAS MODIFIED BY SUN MICROSYSTEMS, INC.
*/
/**
*
* An encoder for handling boolean values. Suppports the builtin BOOLEAN encoder.
*
* @author Alan Hudson
* @author Paul Sandoz
*
*/
/** Table for setting a particular bit of a byte */
private static final int[] BIT_TABLE = {
1 << 7,
1 << 6,
1 << 5,
1 << 4,
1 << 3,
1 << 2,
1 << 1,
1 << 0};
// Cannot determine the number of boolean values from just the octet length
throw new UnsupportedOperationException();
}
if (primitiveLength < 5) {
return 1;
} else {
}
}
public final Object decodeFromBytes(byte[] b, int start, int length) throws EncodingAlgorithmException {
return data;
}
if (value == -1) {
throw new EOFException();
}
int bitPosition = 4;
int bitPositionEnd = 8;
int valueNext = 0;
do {
if (valueNext == -1) {
}
while(bitPosition < bitPositionEnd) {
}
} while (value != -1);
return generateArrayFromList(booleanList);
}
if (!(data instanceof boolean[])) {
throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotBoolean"));
}
int bitPosition = 4;
int astart = 0;
}
if (++bitPosition == 8) {
}
}
if (bitPosition != 8) {
}
}
if (length == 0) {
return new boolean[0];
}
new WordListener() {
} else {
}
}
}
);
return generateArrayFromList(booleanList);
}
return;
}
return;
}
// Insure conservately as all false
for (int i = 0; i <= end; i++) {
if (value[i]) {
s.append("true");
} else {
s.append("false");
}
if (i != end) {
s.append(' ');
}
}
}
public int getPrimtiveLengthFromOctetLength(int octetLength, int firstOctet) throws EncodingAlgorithmException {
if (octetLength == 1) {
if (unusedBits > 3) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.unusedBits4"));
}
return 4 - unusedBits;
} else {
if (unusedBits > 7) {
throw new EncodingAlgorithmException(CommonResourceBundle.getInstance().getString("message.unusedBits8"));
}
}
}
public final void decodeFromBytesToBooleanArray(boolean[] bdata, int bstart, int blength, byte[] b, int start, int length) {
int bitPosition = 4;
if (bitPosition == 8) {
bitPosition = 0;
}
}
}
if (!(array instanceof boolean[])) {
throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.dataNotBoolean"));
}
}
public void encodeToBytesFromBooleanArray(boolean[] array, int astart, int alength, byte[] b, int start) {
int bitPosition = 4;
}
if (++bitPosition == 8) {
}
}
if (bitPosition > 0) {
}
}
/**
*
* Generate a boolean array from a list of Booleans.
*
* @param array The array
*
*/
}
return bdata;
}
}