text: <!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_31) on Mon May 14 18:45:49 PDT 2012 -->
  <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <TITLE>
  ByteArrayBuilder (Jackson-core 2.0.2 API)
  </TITLE>
  
  <META NAME="date" CONTENT="2012-05-14">
  
  <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">
  
  <SCRIPT type="text/javascript">
  function windowTitle()
  {
      if (location.href.indexOf('is-external=true') == -1) {
          parent.document.title="ByteArrayBuilder (Jackson-core 2.0.2 API)";
      }
  }
  </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>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ByteArrayBuilder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
    </TR>
  </TABLE>
  </TD>
  <TD ALIGN="right" VALIGN="top" ROWSPAN=3><script type="text/javascript"><!--
  google_ad_client = "pub-1467773697956887";
  /* Jackson-ad-small */
  google_ad_slot = "6699487946";
  google_ad_width = 234;
  google_ad_height = 60;
  //-->
  </script>
  <script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  </script>
  </TD>
  </TR>
  
  <TR>
  <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  &nbsp;<A HREF="../../../../../com/fasterxml/jackson/core/util/BufferRecycler.CharBufferType.html" title="enum in com.fasterxml.jackson.core.util"><B>PREV CLASS</B></A>&nbsp;
  &nbsp;<A HREF="../../../../../com/fasterxml/jackson/core/util/DefaultPrettyPrinter.html" title="class in com.fasterxml.jackson.core.util"><B>NEXT CLASS</B></A></FONT></TD>
  <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    <A HREF="../../../../../index.html?com/fasterxml/jackson/core/util/ByteArrayBuilder.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  &nbsp;<A HREF="ByteArrayBuilder.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  &nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<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.fasterxml.jackson.core.util</FONT>
  <BR>
  Class ByteArrayBuilder</H2>
  <PRE>
  <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
    <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">java.io.OutputStream</A>
        <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>com.fasterxml.jackson.core.util.ByteArrayBuilder</B>
  </PRE>
  <DL>
  <DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</A></DD>
  </DL>
  <HR>
  <DL>
  <DT><PRE>public final class <B>ByteArrayBuilder</B><DT>extends <A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></DL>
  </PRE>
  
  <P>
  Helper class that is similar to <A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/ByteArrayOutputStream.html?is-external=true" title="class or interface in java.io"><CODE>ByteArrayOutputStream</CODE></A>
   in usage, but more geared to Jackson use cases internally.
   Specific changes include segment storage (no need to have linear
   backing buffer, can avoid reallocs, copying), as well API
   not based on <A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io"><CODE>OutputStream</CODE></A>. In short, a very much
   specialized builder object.
  <p>
   Since version 1.5, also implements <A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io"><CODE>OutputStream</CODE></A> to allow
   efficient aggregation of output content as a byte array, similar
   to how <A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/ByteArrayOutputStream.html?is-external=true" title="class or interface in java.io"><CODE>ByteArrayOutputStream</CODE></A> works, but somewhat more
   efficiently for many use cases.
  <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/fasterxml/jackson/core/util/ByteArrayBuilder.html#ByteArrayBuilder()">ByteArrayBuilder</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#ByteArrayBuilder(com.fasterxml.jackson.core.util.BufferRecycler)">ByteArrayBuilder</A></B>(<A HREF="../../../../../com/fasterxml/jackson/core/util/BufferRecycler.html" title="class in com.fasterxml.jackson.core.util">BufferRecycler</A>&nbsp;br)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#ByteArrayBuilder(com.fasterxml.jackson.core.util.BufferRecycler, int)">ByteArrayBuilder</A></B>(<A HREF="../../../../../com/fasterxml/jackson/core/util/BufferRecycler.html" title="class in com.fasterxml.jackson.core.util">BufferRecycler</A>&nbsp;br,
                   int&nbsp;firstBlockSize)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#ByteArrayBuilder(int)">ByteArrayBuilder</A></B>(int&nbsp;firstBlockSize)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  </TABLE>
  &nbsp;
  <!-- ========== 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>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#append(int)">append</A></B>(int&nbsp;i)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#appendThreeBytes(int)">appendThreeBytes</A></B>(int&nbsp;b24)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#appendTwoBytes(int)">appendTwoBytes</A></B>(int&nbsp;b16)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#close()">close</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;byte[]</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#completeAndCoalesce(int)">completeAndCoalesce</A></B>(int&nbsp;lastBlockLength)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method that will complete "manual" output process, coalesce
   content (if necessary) and return results as a contiguous buffer.</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;byte[]</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#finishCurrentSegment()">finishCurrentSegment</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called when the current segment buffer is full; will
   append to current contents, allocate a new segment buffer
   and return it</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#flush()">flush</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;byte[]</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#getCurrentSegment()">getCurrentSegment</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;int</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#getCurrentSegmentLength()">getCurrentSegmentLength</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#release()">release</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Clean up method to call to release all buffers this object may be
   using.</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#reset()">reset</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;byte[]</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#resetAndGetFirstSegment()">resetAndGetFirstSegment</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called when starting "manual" output: will clear out
   current state and return the first segment buffer to fill</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#setCurrentSegmentLength(int)">setCurrentSegmentLength</A></B>(int&nbsp;len)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;byte[]</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#toByteArray()">toByteArray</A></B>()</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Method called when results are finalized and we can get the
   full aggregated result buffer to return to the caller</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#write(byte[])">write</A></B>(byte[]&nbsp;b)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#write(byte[], int, int)">write</A></B>(byte[]&nbsp;b,
        int&nbsp;off,
        int&nbsp;len)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  <CODE>&nbsp;void</CODE></FONT></TD>
  <TD><CODE><B><A HREF="../../../../../com/fasterxml/jackson/core/util/ByteArrayBuilder.html#write(int)">write</A></B>(int&nbsp;b)</CODE>
  
  <BR>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
  </TR>
  </TABLE>
  &nbsp;<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.<A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
  </TR>
  <TR BGCOLOR="white" CLASS="TableRowColor">
  <TD><CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://docs.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
  </TR>
  </TABLE>
  &nbsp;
  <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="ByteArrayBuilder()"><!-- --></A><H3>
  ByteArrayBuilder</H3>
  <PRE>
  public <B>ByteArrayBuilder</B>()</PRE>
  <DL>
  </DL>
  <HR>
  
  <A NAME="ByteArrayBuilder(com.fasterxml.jackson.core.util.BufferRecycler)"><!-- --></A><H3>
  ByteArrayBuilder</H3>
  <PRE>
  public <B>ByteArrayBuilder</B>(<A HREF="../../../../../com/fasterxml/jackson/core/util/BufferRecycler.html" title="class in com.fasterxml.jackson.core.util">BufferRecycler</A>&nbsp;br)</PRE>
  <DL>
  </DL>
  <HR>
  
  <A NAME="ByteArrayBuilder(int)"><!-- --></A><H3>
  ByteArrayBuilder</H3>
  <PRE>
  public <B>ByteArrayBuilder</B>(int&nbsp;firstBlockSize)</PRE>
  <DL>
  </DL>
  <HR>
  
  <A NAME="ByteArrayBuilder(com.fasterxml.jackson.core.util.BufferRecycler, int)"><!-- --></A><H3>
  ByteArrayBuilder</H3>
  <PRE>
  public <B>ByteArrayBuilder</B>(<A HREF="../../../../../com/fasterxml/jackson/core/util/BufferRecycler.html" title="class in com.fasterxml.jackson.core.util">BufferRecycler</A>&nbsp;br,
                          int&nbsp;firstBlockSize)</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">
  <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  <B>Method Detail</B></FONT></TH>
  </TR>
  </TABLE>
  
  <A NAME="reset()"><!-- --></A><H3>
  reset</H3>
  <PRE>
  public void <B>reset</B>()</PRE>
  <DL>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="release()"><!-- --></A><H3>
  release</H3>
  <PRE>
  public void <B>release</B>()</PRE>
  <DL>
  <DD>Clean up method to call to release all buffers this object may be
   using. After calling the method, no other accessors can be used (and
   attempt to do so may result in an exception)
  <P>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="append(int)"><!-- --></A><H3>
  append</H3>
  <PRE>
  public void <B>append</B>(int&nbsp;i)</PRE>
  <DL>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="appendTwoBytes(int)"><!-- --></A><H3>
  appendTwoBytes</H3>
  <PRE>
  public void <B>appendTwoBytes</B>(int&nbsp;b16)</PRE>
  <DL>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="appendThreeBytes(int)"><!-- --></A><H3>
  appendThreeBytes</H3>
  <PRE>
  public void <B>appendThreeBytes</B>(int&nbsp;b24)</PRE>
  <DL>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="toByteArray()"><!-- --></A><H3>
  toByteArray</H3>
  <PRE>
  public byte[] <B>toByteArray</B>()</PRE>
  <DL>
  <DD>Method called when results are finalized and we can get the
   full aggregated result buffer to return to the caller
  <P>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="resetAndGetFirstSegment()"><!-- --></A><H3>
  resetAndGetFirstSegment</H3>
  <PRE>
  public byte[] <B>resetAndGetFirstSegment</B>()</PRE>
  <DL>
  <DD>Method called when starting "manual" output: will clear out
   current state and return the first segment buffer to fill
  <P>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="finishCurrentSegment()"><!-- --></A><H3>
  finishCurrentSegment</H3>
  <PRE>
  public byte[] <B>finishCurrentSegment</B>()</PRE>
  <DL>
  <DD>Method called when the current segment buffer is full; will
   append to current contents, allocate a new segment buffer
   and return it
  <P>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="completeAndCoalesce(int)"><!-- --></A><H3>
  completeAndCoalesce</H3>
  <PRE>
  public byte[] <B>completeAndCoalesce</B>(int&nbsp;lastBlockLength)</PRE>
  <DL>
  <DD>Method that will complete "manual" output process, coalesce
   content (if necessary) and return results as a contiguous buffer.
  <P>
  <DD><DL>
  <DT><B>Parameters:</B><DD><CODE>lastBlockLength</CODE> - Amount of content in the current segment
   buffer.
  <DT><B>Returns:</B><DD>Coalesced contents</DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="getCurrentSegment()"><!-- --></A><H3>
  getCurrentSegment</H3>
  <PRE>
  public byte[] <B>getCurrentSegment</B>()</PRE>
  <DL>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="setCurrentSegmentLength(int)"><!-- --></A><H3>
  setCurrentSegmentLength</H3>
  <PRE>
  public void <B>setCurrentSegmentLength</B>(int&nbsp;len)</PRE>
  <DL>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="getCurrentSegmentLength()"><!-- --></A><H3>
  getCurrentSegmentLength</H3>
  <PRE>
  public int <B>getCurrentSegmentLength</B>()</PRE>
  <DL>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="write(byte[])"><!-- --></A><H3>
  write</H3>
  <PRE>
  public void <B>write</B>(byte[]&nbsp;b)</PRE>
  <DL>
  <DD><DL>
  <DT><B>Overrides:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#write(byte[])" title="class or interface in java.io">write</A></CODE> in class <CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></DL>
  </DD>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="write(byte[], int, int)"><!-- --></A><H3>
  write</H3>
  <PRE>
  public void <B>write</B>(byte[]&nbsp;b,
                    int&nbsp;off,
                    int&nbsp;len)</PRE>
  <DL>
  <DD><DL>
  <DT><B>Overrides:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#write(byte[], int, int)" title="class or interface in java.io">write</A></CODE> in class <CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></DL>
  </DD>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="write(int)"><!-- --></A><H3>
  write</H3>
  <PRE>
  public void <B>write</B>(int&nbsp;b)</PRE>
  <DL>
  <DD><DL>
  <DT><B>Specified by:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#write(int)" title="class or interface in java.io">write</A></CODE> in class <CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></DL>
  </DD>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="close()"><!-- --></A><H3>
  close</H3>
  <PRE>
  public void <B>close</B>()</PRE>
  <DL>
  <DD><DL>
  <DT><B>Specified by:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/Closeable.html?is-external=true#close()" title="class or interface in java.io">close</A></CODE> in interface <CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/Closeable.html?is-external=true" title="class or interface in java.io">Closeable</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#close()" title="class or interface in java.io">close</A></CODE> in class <CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></DL>
  </DD>
  <DD><DL>
  </DL>
  </DD>
  </DL>
  <HR>
  
  <A NAME="flush()"><!-- --></A><H3>
  flush</H3>
  <PRE>
  public void <B>flush</B>()</PRE>
  <DL>
  <DD><DL>
  <DT><B>Specified by:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/Flushable.html?is-external=true#flush()" title="class or interface in java.io">flush</A></CODE> in interface <CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/Flushable.html?is-external=true" title="class or interface in java.io">Flushable</A></CODE><DT><B>Overrides:</B><DD><CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true#flush()" title="class or interface in java.io">flush</A></CODE> in class <CODE><A HREF="http://docs.oracle.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></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 rowspan='3'><script type="text/javascript"><!--
  google_ad_client = "pub-1467773697956887";
  /* Jackson-ad-small */
  google_ad_slot = "6699487946";
  google_ad_width = 234;
  google_ad_height = 60;
  //-->
  </script>
  <script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  </script>
  <!-- GA -->
  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-140287-6");
  pageTracker._trackPageview();
  } catch(err) {}
  </script>
  </td>
  <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>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ByteArrayBuilder.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
    <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
    </TR>
  </TABLE>
  </TD>
  <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  </EM>
  </TD>
  </TR>
  
  <TR>
  <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  &nbsp;<A HREF="../../../../../com/fasterxml/jackson/core/util/BufferRecycler.CharBufferType.html" title="enum in com.fasterxml.jackson.core.util"><B>PREV CLASS</B></A>&nbsp;
  &nbsp;<A HREF="../../../../../com/fasterxml/jackson/core/util/DefaultPrettyPrinter.html" title="class in com.fasterxml.jackson.core.util"><B>NEXT CLASS</B></A></FONT></TD>
  <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
    <A HREF="../../../../../index.html?com/fasterxml/jackson/core/util/ByteArrayBuilder.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  &nbsp;<A HREF="ByteArrayBuilder.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  &nbsp;<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:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
  <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
  </TR>
  </TABLE>
  <A NAME="skip-navbar_bottom"></A>
  <!-- ======== END OF BOTTOM NAVBAR ======= -->
  
  <HR>
  Copyright &#169; 2012 <a href="http://fasterxml.com">fasterxml.com</a>. All Rights Reserved.
  </BODY>
  </HTML>
  