/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*
*/
// Opaque.java: Wrapper for byte[].
// Author: James Kempf
// Created On: Tue Apr 7 15:21:58 1998
// Last Modified By: James Kempf
// Last Modified On: Fri Jun 5 15:26:59 1998
// Update Count: 38
//
/**
* The Opaque class wraps Java byte arrays so we can do object-like
* things, such as deep equality comparison and printing.
*
* @author James Kempf
*/
// Character to use for fill.
// The byte array.
byte[] bytes;
// For identifying opaques.
// Construct a Opaque.
}
// Construct a byte array from an escaped string.
throws ServiceLocationException {
// Check for opaque header.
throw
"no_opaque_header",
}
// Process escapes to remove slash.
// string.
int len = 0;
int nlen = n / 3;
byte[] b = new byte[nlen];
for (i = 0; i < n; i++) {
throw
"escape_err",
}
// Get the next two characters.
if (i > n - 2) {
throw
"nonterminating_escape",
}
throw
"wrong_char_num",
}
try {
i++;
i++;
} catch (NumberFormatException ex) {
throw
"not_hex",
}
}
return b;
}
// Overrides Object.equals().
if (o == this) {
return true;
}
if (!(o instanceof Opaque)) {
return false;
}
// Not equal if lengths aren't.
return false;
}
// Check inside.
int i;
return false;
}
}
return true;
}
for (i = 0; i < n; i++) {
// Convert each byte into a string, then escape. We use
// an 8-bit encoding, LATIN1, since escapes are two
// characters only.
}
}
}
}