<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0-google-v4) on Fri Sep 09 16:39:32 CDT 2011 --> <TITLE> ByteRange </TITLE> <META NAME="date" CONTENT="2011-09-09"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../dev_javadoc.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="ByteRange"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_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="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="../../../../../com/google/appengine/api/blobstore/BlobstoreServiceFactory.html" title="class in com.google.appengine.api.blobstore"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/appengine/api/blobstore/RangeFormatException.html" title="class in com.google.appengine.api.blobstore"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/blobstore/ByteRange.html" target="_top"><B>FRAMES</B></A> <A HREF="ByteRange.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 | 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> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> com.google.appengine.api.blobstore</FONT> <BR> Class ByteRange</H2> <PRE> java.lang.Object <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.google.appengine.api.blobstore.ByteRange</B> </PRE> <HR> <DL> <DT><PRE>public class <B>ByteRange</B><DT>extends java.lang.Object</DL> </PRE> <P> A byte range as parsed from a request Range header. Format produced by this class is also compatible with the X-AppEngine-BlobRange header, used for serving sub-ranges of blobs. <P> <P> <HR> <P> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <A NAME="constructor_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Constructor Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#ByteRange(long)">ByteRange</A></B>(long start)</CODE> <BR> Constructor.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#ByteRange(long, long)">ByteRange</A></B>(long start, long end)</CODE> <BR> Constructor.</TD> </TR> </TABLE> <!-- ========== METHOD SUMMARY =========== --> <A NAME="method_summary"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> <B>Method Summary</B></FONT></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#equals(java.lang.Object)">equals</A></B>(java.lang.Object object)</CODE> <BR> Two <code>ByteRange</code> objects are considered equal if they have the same start and end.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#getEnd()">getEnd</A></B>()</CODE> <BR> Get end index of byte range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> long</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#getStart()">getStart</A></B>()</CODE> <BR> Get start index of byte range.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> boolean</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#hasEnd()">hasEnd</A></B>()</CODE> <BR> Indicates whether or not this byte range indicates an end.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> int</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#hashCode()">hashCode</A></B>()</CODE> <BR> </TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html" title="class in com.google.appengine.api.blobstore">ByteRange</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#parse(java.lang.String)">parse</A></B>(java.lang.String byteRange)</CODE> <BR> Parse byte range from header.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE>static <A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html" title="class in com.google.appengine.api.blobstore">ByteRange</A></CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#parseContentRange(java.lang.String)">parseContentRange</A></B>(java.lang.String contentRange)</CODE> <BR> Parse content range from header for byte-range only.</TD> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> <CODE> java.lang.String</CODE></FONT></TD> <TD><CODE><B><A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html#toString()">toString</A></B>()</CODE> <BR> Format byte range for use in header.</TD> </TR> </TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"> <TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH> </TR> <TR BGCOLOR="white" CLASS="TableRowColor"> <TD><CODE>getClass, notify, notifyAll, wait, wait, wait</CODE></TD> </TR> </TABLE> <P> <!-- ========= CONSTRUCTOR DETAIL ======== --> <A NAME="constructor_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Constructor Detail</B></FONT></TH> </TR> </TABLE> <A NAME="ByteRange(long)"><!-- --></A><H3> ByteRange</H3> <PRE> public <B>ByteRange</B>(long start)</PRE> <DL> <DD>Constructor. <P> <DL> <DT><B>Parameters:</B><DD><CODE>start</CODE> - Start index of blob range to serve. If negative, serve the last abs(start) bytes of the blob.</DL> </DL> <HR> <A NAME="ByteRange(long, long)"><!-- --></A><H3> ByteRange</H3> <PRE> public <B>ByteRange</B>(long start, long end)</PRE> <DL> <DD>Constructor. <P> <DL> <DT><B>Parameters:</B><DD><CODE>start</CODE> - Start index of blob range to serve. May not be negative.<DD><CODE>end</CODE> - End index of blob range to serve. Index is inclusive, meaning the byte indicated by end is included in the response.</DL> </DL> <!-- ============ METHOD DETAIL ========== --> <A NAME="method_detail"><!-- --></A> <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> <B>Method Detail</B></FONT></TH> </TR> </TABLE> <A NAME="hasEnd()"><!-- --></A><H3> hasEnd</H3> <PRE> public boolean <B>hasEnd</B>()</PRE> <DL> <DD>Indicates whether or not this byte range indicates an end. <P> <DD><DL> <DT><B>Returns:</B><DD>true if byte range has an end.</DL> </DD> </DL> <HR> <A NAME="getStart()"><!-- --></A><H3> getStart</H3> <PRE> public long <B>getStart</B>()</PRE> <DL> <DD>Get start index of byte range. <P> <DD><DL> <DT><B>Returns:</B><DD>Start index of byte range.</DL> </DD> </DL> <HR> <A NAME="getEnd()"><!-- --></A><H3> getEnd</H3> <PRE> public long <B>getEnd</B>()</PRE> <DL> <DD>Get end index of byte range. <P> <DD><DL> <DT><B>Returns:</B><DD>End index of byte range. <DT><B>Throws:</B> <DD><CODE>java.lang.IllegalStateException</CODE> - if byte range does not have an end range.</DL> </DD> </DL> <HR> <A NAME="toString()"><!-- --></A><H3> toString</H3> <PRE> public java.lang.String <B>toString</B>()</PRE> <DL> <DD>Format byte range for use in header. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE>toString</CODE> in class <CODE>java.lang.Object</CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="parse(java.lang.String)"><!-- --></A><H3> parse</H3> <PRE> public static <A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html" title="class in com.google.appengine.api.blobstore">ByteRange</A> <B>parse</B>(java.lang.String byteRange)</PRE> <DL> <DD>Parse byte range from header. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>byteRange</CODE> - Byte range string as received from header. <DT><B>Returns:</B><DD>ByteRange object set to byte range as parsed from string. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../com/google/appengine/api/blobstore/RangeFormatException.html" title="class in com.google.appengine.api.blobstore">RangeFormatException</A></CODE> - Unable to parse header because of invalid format. <DD><CODE><A HREF="../../../../../com/google/appengine/api/blobstore/UnsupportedRangeFormatException.html" title="class in com.google.appengine.api.blobstore">UnsupportedRangeFormatException</A></CODE> - Header is a valid HTTP range header, the specific form is not supported by app engine. This includes unit types other than "bytes" and multiple ranges.</DL> </DD> </DL> <HR> <A NAME="parseContentRange(java.lang.String)"><!-- --></A><H3> parseContentRange</H3> <PRE> public static <A HREF="../../../../../com/google/appengine/api/blobstore/ByteRange.html" title="class in com.google.appengine.api.blobstore">ByteRange</A> <B>parseContentRange</B>(java.lang.String contentRange)</PRE> <DL> <DD>Parse content range from header for byte-range only. <P> <DD><DL> <DT><B>Parameters:</B><DD><CODE>contentRange</CODE> - Content range string as received from header. <DT><B>Returns:</B><DD>ByteRange object set to byte range as parsed from string, but does not include the size information. <DT><B>Throws:</B> <DD><CODE><A HREF="../../../../../com/google/appengine/api/blobstore/RangeFormatException.html" title="class in com.google.appengine.api.blobstore">RangeFormatException</A></CODE> - Unable to parse header because of invalid format.</DL> </DD> </DL> <HR> <A NAME="hashCode()"><!-- --></A><H3> hashCode</H3> <PRE> public int <B>hashCode</B>()</PRE> <DL> <DD><DL> <DT><B>Overrides:</B><DD><CODE>hashCode</CODE> in class <CODE>java.lang.Object</CODE></DL> </DD> <DD><DL> </DL> </DD> </DL> <HR> <A NAME="equals(java.lang.Object)"><!-- --></A><H3> equals</H3> <PRE> public boolean <B>equals</B>(java.lang.Object object)</PRE> <DL> <DD>Two <code>ByteRange</code> objects are considered equal if they have the same start and end. <P> <DD><DL> <DT><B>Overrides:</B><DD><CODE>equals</CODE> in class <CODE>java.lang.Object</CODE></DL> </DD> <DD><DL> </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=2 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="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="../../../../../com/google/appengine/api/blobstore/BlobstoreServiceFactory.html" title="class in com.google.appengine.api.blobstore"><B>PREV CLASS</B></A> <A HREF="../../../../../com/google/appengine/api/blobstore/RangeFormatException.html" title="class in com.google.appengine.api.blobstore"><B>NEXT CLASS</B></A></FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../../index.html?com/google/appengine/api/blobstore/ByteRange.html" target="_top"><B>FRAMES</B></A> <A HREF="ByteRange.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 | 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> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>