📄 hex.html
字号:
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="Hex()"><!-- --></A><H3>
Hex</H3>
<PRE>
public <B>Hex</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="decodeHex(char[])"><!-- --></A><H3>
decodeHex</H3>
<PRE>
public static byte[] <B>decodeHex</B>(char[] data) throws <A HREF="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</A></PRE>
<DL>
<DD>Converts an array of characters representing hexidecimal values into an array of bytes of those same values. The returned array will be half the length of the passed array, as it takes two characters to represent any given byte. An exception is thrown if the passed char array has an odd number of elements.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - An array of characters containing hexidecimal digits<DT><B>Returns:</B><DD>A byte array containing binary data decoded from the supplied char array.<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</A></CODE> - Thrown if an odd number or illegal of characters is supplied</DL>
</DD>
</DL>
<HR>
<A NAME="toDigit(char, int)"><!-- --></A><H3>
toDigit</H3>
<PRE>
protected static int <B>toDigit</B>(char ch, int index) throws <A HREF="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</A></PRE>
<DL>
<DD>Converts a hexadecimal character to an integer.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>ch</CODE> - A character to convert to an integer digit<DD><CODE>index</CODE> - The index of the character in the source<DT><B>Returns:</B><DD>An integer<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</A></CODE> - Thrown if ch is an illegal hex character</DL>
</DD>
</DL>
<HR>
<A NAME="encodeHex(byte[])"><!-- --></A><H3>
encodeHex</H3>
<PRE>
public static char[] <B>encodeHex</B>(byte[] data)</PRE>
<DL>
<DD>Converts an array of bytes into an array of characters representing the hexidecimal values of each byte in order. The returned array will be double the length of the passed array, as it takes two characters to represent any given byte.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - a byte[] to convert to Hex characters<DT><B>Returns:</B><DD>A char[] containing hexidecimal characters</DL>
</DD>
</DL>
<HR>
<A NAME="decode(byte[])"><!-- --></A><H3>
decode</H3>
<PRE>
public byte[] <B>decode</B>(byte[] array) throws <A HREF="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</A></PRE>
<DL>
<DD>Converts an array of character bytes representing hexidecimal values into an array of bytes of those same values. The returned array will be half the length of the passed array, as it takes two characters to represent any given byte. An exception is thrown if the passed char array has an odd number of elements.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/BinaryDecoder.html#decode(byte[])">decode</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/codec/BinaryDecoder.html" title="interface in org.apache.commons.codec">BinaryDecoder</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>array</CODE> - An array of character bytes containing hexidecimal digits<DT><B>Returns:</B><DD>A byte array containing binary data decoded from the supplied byte array (representing characters).<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</A></CODE> - Thrown if an odd number of characters is supplied to this function<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/codec/binary/Hex.html#decodeHex(char[])"><CODE>decodeHex(char[])</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="decode(java.lang.Object)"><!-- --></A><H3>
decode</H3>
<PRE>
public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>decode</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object) throws <A HREF="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</A></PRE>
<DL>
<DD>Converts a String or an array of character bytes representing hexidecimal values into an array of bytes of those same values. The returned array will be half the length of the passed String or array, as it takes two characters to represent any given byte. An exception is thrown if the passed char array has an odd number of elements.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/Decoder.html#decode(java.lang.Object)">decode</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/codec/Decoder.html" title="interface in org.apache.commons.codec">Decoder</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>object</CODE> - A String or, an array of character bytes containing hexidecimal digits<DT><B>Returns:</B><DD>A byte array containing binary data decoded from the supplied byte array (representing characters).<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/DecoderException.html" title="class in org.apache.commons.codec">DecoderException</A></CODE> - Thrown if an odd number of characters is supplied to this function or the object is not a String or char[]<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/codec/binary/Hex.html#decodeHex(char[])"><CODE>decodeHex(char[])</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="encode(byte[])"><!-- --></A><H3>
encode</H3>
<PRE>
public byte[] <B>encode</B>(byte[] array)</PRE>
<DL>
<DD>Converts an array of bytes into an array of bytes for the characters representing the hexidecimal values of each byte in order. The returned array will be double the length of the passed array, as it takes two characters to represent any given byte.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/BinaryEncoder.html#encode(byte[])">encode</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/codec/BinaryEncoder.html" title="interface in org.apache.commons.codec">BinaryEncoder</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>array</CODE> - a byte[] to convert to Hex characters<DT><B>Returns:</B><DD>A byte[] containing the bytes of the hexidecimal characters<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/codec/binary/Hex.html#encodeHex(byte[])"><CODE>encodeHex(byte[])</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="encode(java.lang.Object)"><!-- --></A><H3>
encode</H3>
<PRE>
public <A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> <B>encode</B>(<A HREF="http://java.sun.com/products/jdk/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> object) throws <A HREF="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</A></PRE>
<DL>
<DD>Converts a String or an array of bytes into an array of characters representing the hexidecimal values of each byte in order. The returned array will be double the length of the passed String or array, as it takes two characters to represent any given byte.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/Encoder.html#encode(java.lang.Object)">encode</A></CODE> in interface <CODE><A HREF="../../../../../org/apache/commons/codec/Encoder.html" title="interface in org.apache.commons.codec">Encoder</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>object</CODE> - a String, or byte[] to convert to Hex characters<DT><B>Returns:</B><DD>A char[] containing hexidecimal characters<DT><B>Throws:</B><DD><CODE><A HREF="../../../../../org/apache/commons/codec/EncoderException.html" title="class in org.apache.commons.codec">EncoderException</A></CODE> - Thrown if the given object is not a String or byte[]<DT><B>See Also:</B><DD><A HREF="../../../../../org/apache/commons/codec/binary/Hex.html#encodeHex(byte[])"><CODE>encodeHex(byte[])</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Hex.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../org/apache/commons/codec/binary/BinaryCodec.html" title="class in org.apache.commons.codec.binary"><B>PREV CLASS</B></A>
NEXT CLASS</FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../../index.html" target="_top"><B>FRAMES</B></A>
<A HREF="Hex.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
commons-codec version 1.3 - Copyright © 2002-2004 - Apache Software Foundation
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -