📄 binaryparser.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Fri Oct 19 00:05:04 EDT 2001 -->
<TITLE>
jd3Lib - A Java ID3/MP3 Library: Class BinaryParser
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-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">
PREV CLASS
<A HREF="../../helliker/id3/ID3FieldDataException.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="BinaryParser.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
helliker.id3</FONT>
<BR>
Class BinaryParser</H2>
<PRE>
java.lang.Object
|
+--<B>helliker.id3.BinaryParser</B>
</PRE>
<HR>
<DL>
<DT>public final class <B>BinaryParser</B><DT>extends java.lang.Object</DL>
<P>
<HR>
<P>
<!-- ======== INNER CLASS SUMMARY ======== -->
<!-- =========== FIELD SUMMARY =========== -->
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../helliker/id3/BinaryParser.html#BinaryParser()">BinaryParser</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../helliker/id3/BinaryParser.html#bitSet(byte, int)">bitSet</A></B>(byte b, int pos)</CODE>
<BR>
Tests to see if the bit at postion pos is set in byte b</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static byte[]</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../helliker/id3/BinaryParser.html#convertToBytes(int)">convertToBytes</A></B>(int num)</CODE>
<BR>
Convert the integer passed to a array of 4 bytes (32-bits).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../helliker/id3/BinaryParser.html#convertToDecimal(byte, int, int)">convertToDecimal</A></B>(byte b, int start, int end)</CODE>
<BR>
Convert a portion of a byte to an integer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../helliker/id3/BinaryParser.html#convertToInt(byte[])">convertToInt</A></B>(byte[] b)</CODE>
<BR>
Convert an array of bytes into an integer.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../helliker/id3/BinaryParser.html#matchPattern(byte, java.lang.String)">matchPattern</A></B>(byte b, java.lang.String pattern)</CODE>
<BR>
This function takes an 8 character string representation of a byte in binary mode.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static byte</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../helliker/id3/BinaryParser.html#setBit(byte, int)">setBit</A></B>(byte b, int location)</CODE>
<BR>
Sets the bit at the specified location in the byte given.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="BinaryParser()"><!-- --></A><H3>
BinaryParser</H3>
<PRE>
public <B>BinaryParser</B>()</PRE>
<DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="bitSet(byte, int)"><!-- --></A><H3>
bitSet</H3>
<PRE>
public static boolean <B>bitSet</B>(byte b, int pos)</PRE>
<DL>
<DD>Tests to see if the bit at postion pos is set in byte b<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the byte to test<DD><CODE>pos</CODE> - a value between 0 (least significant bit) and 7 (most significant bit) indicating the position to test<DT><B>Returns:</B><DD>true if the bit at the location is set</DL>
</DD>
</DL>
<HR>
<A NAME="matchPattern(byte, java.lang.String)"><!-- --></A><H3>
matchPattern</H3>
<PRE>
public static boolean <B>matchPattern</B>(byte b, java.lang.String pattern)</PRE>
<DL>
<DD>This function takes an 8 character string representation of a byte in binary mode. It will match 0's and 1's at the locations specified and skip other characters (x is the standard wildcard). If the values of the bits at the locations where a 0 is set is 0 and values of the bits at the locations where 1 is set is 1, then the function will return true.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the byte to test<DD><CODE>pattern</CODE> - the 8 character long pattern to test the byte<DT><B>Returns:</B><DD>true if the bits at the locations specified are set</DL>
</DD>
</DL>
<HR>
<A NAME="convertToDecimal(byte, int, int)"><!-- --></A><H3>
convertToDecimal</H3>
<PRE>
public static int <B>convertToDecimal</B>(byte b, int start, int end)</PRE>
<DL>
<DD>Convert a portion of a byte to an integer. This assumes that the length of the byte is end - start bits long with end being the most significant bit. The start and end values must be between 0 and 7. If the start and end values are incorrect, it will set start to 0 and end to 7.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the byte to convert from<DD><CODE>start</CODE> - the starting bit<DD><CODE>end</CODE> - the ending bit<DT><B>Returns:</B><DD>the converted value (unsigned)</DL>
</DD>
</DL>
<HR>
<A NAME="convertToInt(byte[])"><!-- --></A><H3>
convertToInt</H3>
<PRE>
public static int <B>convertToInt</B>(byte[] b)</PRE>
<DL>
<DD>Convert an array of bytes into an integer. The array must not contain more than 4 bytes (32 bits). This assumes that the most significant byte is in the first index of the array. If an array is not 4 bytes long, then it will assume that the bytes are preceded by leading 0's.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the array of bytes<DT><B>Returns:</B><DD>the converted integer in decimal</DL>
</DD>
</DL>
<HR>
<A NAME="convertToBytes(int)"><!-- --></A><H3>
convertToBytes</H3>
<PRE>
public static byte[] <B>convertToBytes</B>(int num)</PRE>
<DL>
<DD>Convert the integer passed to a array of 4 bytes (32-bits). Does the opposite of the convertToInt method.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>num</CODE> - the integer to convert<DT><B>Returns:</B><DD>the integer converted to a byte array</DL>
</DD>
</DL>
<HR>
<A NAME="setBit(byte, int)"><!-- --></A><H3>
setBit</H3>
<PRE>
public static byte <B>setBit</B>(byte b, int location)</PRE>
<DL>
<DD>Sets the bit at the specified location in the byte given. Location should be between 0 and 7. If an invalid location is specified, 0 will be returned.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>b</CODE> - the byte to set the index in<DD><CODE>location</CODE> - the index to set in b<DT><B>Returns:</B><DD>b with the bit at location set to 1</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-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">
PREV CLASS
<A HREF="../../helliker/id3/ID3FieldDataException.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>
<A HREF="BinaryParser.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: INNER | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->
<HR>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -