📄 wbxmlutility.java
字号:
/*
* j2wap is distributed under the terms of the GNU Public License
*
* j2wap was written by:
*
* Scott Campbell
* Michael Nordling
* Karl Maftoum
* Julian Bright
*
* This was a final project for Comp.Engineering at the University of Canberra, Australia
*
* Now released as Open Source software. 28 November 2000
*
* Email: k_maftoum@hotmail.com for more info
*
* Use entirely at your own risk.
*/
package wae;
import java.io.IOException;
import java.io.ByteArrayInputStream;
/**
* Title: WbxmlUtility
* Description: This class encapsulates functionality to manipulate
* WBXML bytecode.
* Company: J2wap.com
* @author Scott Campbell
* @version 1.1
*/
public class WbxmlUtility
{
// Public Attributes
/** Low byte mask. */
public static final int c_LowByteMask = 0x7f;
/**
* Dtermines if an identifier has content following it.
* An identifier has content if the second most significant bit
* in the byte is '1'.
* @param in_intValue The byte that represents a WML token.
* @return True if the identifier has the bit set that flags content.
*/
public boolean hasContent (int in_intValue) throws IOException
{
return ((in_intValue & 0x40) != 0);
} // hasContent
/**
* Determine if an identifier has attributes.
* An identifier has attributes if the msb in the
* byte is '1'.
* @param in_intValue The byte that represents a WML token.
* @return True if the identifier has the bit set that flags attributes.
*/
public boolean hasAttributes (int in_intValue) throws IOException
{
return ((in_intValue & 0x80) != 0);
} // hasAttributes
/**
* Determines if there are more octets in the multi-byte
* integer. The most significant bit in each octet is the
* "continuation bit". The final octet in the series has
* it's "continuation bit" set to '0'.
* @param in_intValue The byte that represents a WML token.
* @return True if there are more octets in the multi-byte
* integer.
*/
public boolean moreBytesInMBInt (int in_intValue) throws IOException
{
return ((in_intValue & 0x80) != 0);
} // moreBytesInMBInt
/**
* Determines if the string is part of an attribute value string.
* @param in_intValue The byte that represents a WML token.
* @return True if the string is part of an attribute value string.
*/
public boolean isAttributeValueString (int in_intValue) throws IOException
{
return ((in_intValue & 0x80) != 0);
} // isAttributeValueString
} // WbxmlUtility
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -