| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
| <!-- NewPage --> |
| <html lang="en"> |
| <head> |
| <!-- Generated by javadoc (1.8.0_292) on Tue Jun 15 06:00:49 GMT 2021 --> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <title>BytesWritable (Apache Hadoop Main 3.3.1 API)</title> |
| <meta name="date" content="2021-06-15"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| </head> |
| <body> |
| <script type="text/javascript"><!-- |
| try { |
| if (location.href.indexOf('is-external=true') == -1) { |
| parent.document.title="BytesWritable (Apache Hadoop Main 3.3.1 API)"; |
| } |
| } |
| catch(err) { |
| } |
| //--> |
| var methods = {"i0":10,"i1":10,"i2":42,"i3":10,"i4":10,"i5":10,"i6":42,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10}; |
| var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]}; |
| var altColor = "altColor"; |
| var rowColor = "rowColor"; |
| var tableTab = "tableTab"; |
| var activeTableTab = "activeTableTab"; |
| </script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="topNav"><a name="navbar.top"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.top.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/BytesWritable.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/hadoop/io/ByteBufferPool.html" title="interface in org.apache.hadoop.io"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/hadoop/io/ByteWritable.html" title="class in org.apache.hadoop.io"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/hadoop/io/BytesWritable.html" target="_top">Frames</a></li> |
| <li><a href="BytesWritable.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_top"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_top"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.top"> |
| <!-- --> |
| </a></div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="subTitle">org.apache.hadoop.io</div> |
| <h2 title="Class BytesWritable" class="title">Class BytesWritable</h2> |
| </div> |
| <div class="contentContainer"> |
| <ul class="inheritance"> |
| <li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li><a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">org.apache.hadoop.io.BinaryComparable</a></li> |
| <li> |
| <ul class="inheritance"> |
| <li>org.apache.hadoop.io.BytesWritable</li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <div class="description"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <dl> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a><<a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a>>, <a href="../../../../org/apache/hadoop/io/Writable.html" title="interface in org.apache.hadoop.io">Writable</a>, <a href="../../../../org/apache/hadoop/io/WritableComparable.html" title="interface in org.apache.hadoop.io">WritableComparable</a><<a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a>></dd> |
| </dl> |
| <hr> |
| <br> |
| <pre>@InterfaceAudience.Public |
| @InterfaceStability.Stable |
| public class <span class="typeNameLabel">BytesWritable</span> |
| extends <a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a> |
| implements <a href="../../../../org/apache/hadoop/io/WritableComparable.html" title="interface in org.apache.hadoop.io">WritableComparable</a><<a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a>></pre> |
| <div class="block">A byte sequence that is usable as a key or value. |
| It is resizable and distinguishes between the size of the sequence and |
| the current capacity. The hash function is the front of the md5 of the |
| buffer. The sort order is the same as memcmp.</div> |
| </li> |
| </ul> |
| </div> |
| <div class="summary"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.summary"> |
| <!-- --> |
| </a> |
| <h3>Constructor Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> |
| <caption><span>Constructors</span><span class="tabEnd"> </span></caption> |
| <tr> |
| <th class="colOne" scope="col">Constructor and Description</th> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#BytesWritable--">BytesWritable</a></span>()</code> |
| <div class="block">Create a zero-size sequence.</div> |
| </td> |
| </tr> |
| <tr class="rowColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#BytesWritable-byte:A-">BytesWritable</a></span>(byte[] bytes)</code> |
| <div class="block">Create a BytesWritable using the byte array as the initial value.</div> |
| </td> |
| </tr> |
| <tr class="altColor"> |
| <td class="colOne"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#BytesWritable-byte:A-int-">BytesWritable</a></span>(byte[] bytes, |
| int length)</code> |
| <div class="block">Create a BytesWritable using the byte array as the initial value |
| and length as the length.</div> |
| </td> |
| </tr> |
| </table> |
| </li> |
| </ul> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.summary"> |
| <!-- --> |
| </a> |
| <h3>Method Summary</h3> |
| <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> |
| <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption> |
| <tr> |
| <th class="colFirst" scope="col">Modifier and Type</th> |
| <th class="colLast" scope="col">Method and Description</th> |
| </tr> |
| <tr id="i0" class="altColor"> |
| <td class="colFirst"><code>byte[]</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#copyBytes--">copyBytes</a></span>()</code> |
| <div class="block">Get a copy of the bytes that is exactly the length of the data.</div> |
| </td> |
| </tr> |
| <tr id="i1" class="rowColor"> |
| <td class="colFirst"><code>boolean</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#equals-java.lang.Object-">equals</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> right_obj)</code> |
| <div class="block">Are the two byte sequences equal?</div> |
| </td> |
| </tr> |
| <tr id="i2" class="altColor"> |
| <td class="colFirst"><code>byte[]</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#get--">get</a></span>()</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">Use <a href="../../../../org/apache/hadoop/io/BytesWritable.html#getBytes--"><code>getBytes()</code></a> instead.</span></div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i3" class="rowColor"> |
| <td class="colFirst"><code>byte[]</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#getBytes--">getBytes</a></span>()</code> |
| <div class="block">Get the data backing the BytesWritable.</div> |
| </td> |
| </tr> |
| <tr id="i4" class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#getCapacity--">getCapacity</a></span>()</code> |
| <div class="block">Get the capacity, which is the maximum size that could handled without |
| resizing the backing storage.</div> |
| </td> |
| </tr> |
| <tr id="i5" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#getLength--">getLength</a></span>()</code> |
| <div class="block">Get the current size of the buffer.</div> |
| </td> |
| </tr> |
| <tr id="i6" class="altColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#getSize--">getSize</a></span>()</code> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> |
| <div class="block"><span class="deprecationComment">Use <a href="../../../../org/apache/hadoop/io/BytesWritable.html#getLength--"><code>getLength()</code></a> instead.</span></div> |
| </div> |
| </td> |
| </tr> |
| <tr id="i7" class="rowColor"> |
| <td class="colFirst"><code>int</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#hashCode--">hashCode</a></span>()</code> |
| <div class="block">Return a hash of the bytes returned from {#getBytes()}.</div> |
| </td> |
| </tr> |
| <tr id="i8" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#readFields-java.io.DataInput-">readFields</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io">DataInput</a> in)</code> |
| <div class="block">Deserialize the fields of this object from <code>in</code>.</div> |
| </td> |
| </tr> |
| <tr id="i9" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#set-byte:A-int-int-">set</a></span>(byte[] newData, |
| int offset, |
| int length)</code> |
| <div class="block">Set the value to a copy of the given byte range</div> |
| </td> |
| </tr> |
| <tr id="i10" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#set-org.apache.hadoop.io.BytesWritable-">set</a></span>(<a href="../../../../org/apache/hadoop/io/BytesWritable.html" title="class in org.apache.hadoop.io">BytesWritable</a> newData)</code> |
| <div class="block">Set the BytesWritable to the contents of the given newData.</div> |
| </td> |
| </tr> |
| <tr id="i11" class="rowColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#setCapacity-int-">setCapacity</a></span>(int new_cap)</code> |
| <div class="block">Change the capacity of the backing storage.</div> |
| </td> |
| </tr> |
| <tr id="i12" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#setSize-int-">setSize</a></span>(int size)</code> |
| <div class="block">Change the size of the buffer.</div> |
| </td> |
| </tr> |
| <tr id="i13" class="rowColor"> |
| <td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#toString--">toString</a></span>()</code> |
| <div class="block">Generate the stream of bytes as hex pairs separated by ' '.</div> |
| </td> |
| </tr> |
| <tr id="i14" class="altColor"> |
| <td class="colFirst"><code>void</code></td> |
| <td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/hadoop/io/BytesWritable.html#write-java.io.DataOutput-">write</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataOutput.html?is-external=true" title="class or interface in java.io">DataOutput</a> out)</code> |
| <div class="block">Serialize the fields of this object to <code>out</code>.</div> |
| </td> |
| </tr> |
| </table> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.org.apache.hadoop.io.BinaryComparable"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class org.apache.hadoop.io.<a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a></h3> |
| <code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html#compareTo-org.apache.hadoop.io.BinaryComparable-">compareTo</a>, <a href="../../../../org/apache/hadoop/io/BinaryComparable.html#compareTo-byte:A-int-int-">compareTo</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> |
| </ul> |
| <ul class="blockList"> |
| <li class="blockList"><a name="methods.inherited.from.class.java.lang.Comparable"> |
| <!-- --> |
| </a> |
| <h3>Methods inherited from interface java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true" title="class or interface in java.lang">Comparable</a></h3> |
| <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html?is-external=true#compareTo-T-" title="class or interface in java.lang">compareTo</a></code></li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="details"> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="constructor.detail"> |
| <!-- --> |
| </a> |
| <h3>Constructor Detail</h3> |
| <a name="BytesWritable--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>BytesWritable</h4> |
| <pre>public BytesWritable()</pre> |
| <div class="block">Create a zero-size sequence.</div> |
| </li> |
| </ul> |
| <a name="BytesWritable-byte:A-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>BytesWritable</h4> |
| <pre>public BytesWritable(byte[] bytes)</pre> |
| <div class="block">Create a BytesWritable using the byte array as the initial value.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>bytes</code> - This array becomes the backing storage for the object.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="BytesWritable-byte:A-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>BytesWritable</h4> |
| <pre>public BytesWritable(byte[] bytes, |
| int length)</pre> |
| <div class="block">Create a BytesWritable using the byte array as the initial value |
| and length as the length. Use this constructor if the array is larger |
| than the value it represents.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>bytes</code> - This array becomes the backing storage for the object.</dd> |
| <dd><code>length</code> - The number of bytes to use from array.</dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| <!-- ============ METHOD DETAIL ========== --> |
| <ul class="blockList"> |
| <li class="blockList"><a name="method.detail"> |
| <!-- --> |
| </a> |
| <h3>Method Detail</h3> |
| <a name="copyBytes--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>copyBytes</h4> |
| <pre>public byte[] copyBytes()</pre> |
| <div class="block">Get a copy of the bytes that is exactly the length of the data. |
| See <a href="../../../../org/apache/hadoop/io/BytesWritable.html#getBytes--"><code>getBytes()</code></a> for faster access to the underlying array.</div> |
| </li> |
| </ul> |
| <a name="getBytes--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getBytes</h4> |
| <pre>public byte[] getBytes()</pre> |
| <div class="block">Get the data backing the BytesWritable. Please use <a href="../../../../org/apache/hadoop/io/BytesWritable.html#copyBytes--"><code>copyBytes()</code></a> |
| if you need the returned array to be precisely the length of the data.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html#getBytes--">getBytes</a></code> in class <code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a></code></dd> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The data is only valid between 0 and getLength() - 1.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="get--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>get</h4> |
| <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a> |
| public byte[] get()</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">Use <a href="../../../../org/apache/hadoop/io/BytesWritable.html#getBytes--"><code>getBytes()</code></a> instead.</span></div> |
| <div class="block">Get the data from the BytesWritable.</div> |
| </li> |
| </ul> |
| <a name="getLength--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getLength</h4> |
| <pre>public int getLength()</pre> |
| <div class="block">Get the current size of the buffer.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html#getLength--">getLength</a></code> in class <code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getSize--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getSize</h4> |
| <pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Deprecated.html?is-external=true" title="class or interface in java.lang">@Deprecated</a> |
| public int getSize()</pre> |
| <div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">Use <a href="../../../../org/apache/hadoop/io/BytesWritable.html#getLength--"><code>getLength()</code></a> instead.</span></div> |
| <div class="block">Get the current size of the buffer.</div> |
| </li> |
| </ul> |
| <a name="setSize-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setSize</h4> |
| <pre>public void setSize(int size)</pre> |
| <div class="block">Change the size of the buffer. The values in the old range are preserved |
| and any new values are undefined. The capacity is changed if it is |
| necessary.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>size</code> - The new number of bytes</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="getCapacity--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>getCapacity</h4> |
| <pre>public int getCapacity()</pre> |
| <div class="block">Get the capacity, which is the maximum size that could handled without |
| resizing the backing storage.</div> |
| <dl> |
| <dt><span class="returnLabel">Returns:</span></dt> |
| <dd>The number of bytes</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="setCapacity-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>setCapacity</h4> |
| <pre>public void setCapacity(int new_cap)</pre> |
| <div class="block">Change the capacity of the backing storage. |
| The data is preserved.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>new_cap</code> - The new capacity in bytes.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="set-org.apache.hadoop.io.BytesWritable-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>set</h4> |
| <pre>public void set(<a href="../../../../org/apache/hadoop/io/BytesWritable.html" title="class in org.apache.hadoop.io">BytesWritable</a> newData)</pre> |
| <div class="block">Set the BytesWritable to the contents of the given newData.</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>newData</code> - the value to set this BytesWritable to.</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="set-byte:A-int-int-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>set</h4> |
| <pre>public void set(byte[] newData, |
| int offset, |
| int length)</pre> |
| <div class="block">Set the value to a copy of the given byte range</div> |
| <dl> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>newData</code> - the new values to copy in</dd> |
| <dd><code>offset</code> - the offset in newData to start at</dd> |
| <dd><code>length</code> - the number of bytes to copy</dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="readFields-java.io.DataInput-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>readFields</h4> |
| <pre>public void readFields(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataInput.html?is-external=true" title="class or interface in java.io">DataInput</a> in) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../org/apache/hadoop/io/Writable.html#readFields-java.io.DataInput-">Writable</a></code></span></div> |
| <div class="block">Deserialize the fields of this object from <code>in</code>. |
| |
| <p>For efficiency, implementations should attempt to re-use storage in the |
| existing object where possible.</p></div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../org/apache/hadoop/io/Writable.html#readFields-java.io.DataInput-">readFields</a></code> in interface <code><a href="../../../../org/apache/hadoop/io/Writable.html" title="interface in org.apache.hadoop.io">Writable</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>in</code> - <code>DataInput</code> to deseriablize this object from.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="write-java.io.DataOutput-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>write</h4> |
| <pre>public void write(<a href="https://docs.oracle.com/javase/8/docs/api/java/io/DataOutput.html?is-external=true" title="class or interface in java.io">DataOutput</a> out) |
| throws <a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="../../../../org/apache/hadoop/io/Writable.html#write-java.io.DataOutput-">Writable</a></code></span></div> |
| <div class="block">Serialize the fields of this object to <code>out</code>.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> |
| <dd><code><a href="../../../../org/apache/hadoop/io/Writable.html#write-java.io.DataOutput-">write</a></code> in interface <code><a href="../../../../org/apache/hadoop/io/Writable.html" title="interface in org.apache.hadoop.io">Writable</a></code></dd> |
| <dt><span class="paramLabel">Parameters:</span></dt> |
| <dd><code>out</code> - <code>DataOuput</code> to serialize this object into.</dd> |
| <dt><span class="throwsLabel">Throws:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="hashCode--"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>hashCode</h4> |
| <pre>public int hashCode()</pre> |
| <div class="block"><span class="descfrmTypeLabel">Description copied from class: <code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html#hashCode--">BinaryComparable</a></code></span></div> |
| <div class="block">Return a hash of the bytes returned from {#getBytes()}.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html#hashCode--">hashCode</a></code> in class <code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a></code></dd> |
| <dt><span class="seeLabel">See Also:</span></dt> |
| <dd><a href="../../../../org/apache/hadoop/io/WritableComparator.html#hashBytes-byte:A-int-"><code>WritableComparator.hashBytes(byte[],int)</code></a></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="equals-java.lang.Object-"> |
| <!-- --> |
| </a> |
| <ul class="blockList"> |
| <li class="blockList"> |
| <h4>equals</h4> |
| <pre>public boolean equals(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> right_obj)</pre> |
| <div class="block">Are the two byte sequences equal?</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html#equals-java.lang.Object-">equals</a></code> in class <code><a href="../../../../org/apache/hadoop/io/BinaryComparable.html" title="class in org.apache.hadoop.io">BinaryComparable</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| <a name="toString--"> |
| <!-- --> |
| </a> |
| <ul class="blockListLast"> |
| <li class="blockList"> |
| <h4>toString</h4> |
| <pre>public <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString()</pre> |
| <div class="block">Generate the stream of bytes as hex pairs separated by ' '.</div> |
| <dl> |
| <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> |
| <dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code> in class <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> |
| </dl> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| </div> |
| <!-- ========= END OF CLASS DATA ========= --> |
| <!-- ======= START OF BOTTOM NAVBAR ====== --> |
| <div class="bottomNav"><a name="navbar.bottom"> |
| <!-- --> |
| </a> |
| <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> |
| <a name="navbar.bottom.firstrow"> |
| <!-- --> |
| </a> |
| <ul class="navList" title="Navigation"> |
| <li><a href="../../../../overview-summary.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="navBarCell1Rev">Class</li> |
| <li><a href="class-use/BytesWritable.html">Use</a></li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html">Help</a></li> |
| </ul> |
| </div> |
| <div class="subNav"> |
| <ul class="navList"> |
| <li><a href="../../../../org/apache/hadoop/io/ByteBufferPool.html" title="interface in org.apache.hadoop.io"><span class="typeNameLink">Prev Class</span></a></li> |
| <li><a href="../../../../org/apache/hadoop/io/ByteWritable.html" title="class in org.apache.hadoop.io"><span class="typeNameLink">Next Class</span></a></li> |
| </ul> |
| <ul class="navList"> |
| <li><a href="../../../../index.html?org/apache/hadoop/io/BytesWritable.html" target="_top">Frames</a></li> |
| <li><a href="BytesWritable.html" target="_top">No Frames</a></li> |
| </ul> |
| <ul class="navList" id="allclasses_navbar_bottom"> |
| <li><a href="../../../../allclasses-noframe.html">All Classes</a></li> |
| </ul> |
| <div> |
| <script type="text/javascript"><!-- |
| allClassesLink = document.getElementById("allclasses_navbar_bottom"); |
| if(window==top) { |
| allClassesLink.style.display = "block"; |
| } |
| else { |
| allClassesLink.style.display = "none"; |
| } |
| //--> |
| </script> |
| </div> |
| <div> |
| <ul class="subNavList"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li>Field | </li> |
| <li><a href="#constructor.summary">Constr</a> | </li> |
| <li><a href="#method.summary">Method</a></li> |
| </ul> |
| <ul class="subNavList"> |
| <li>Detail: </li> |
| <li>Field | </li> |
| <li><a href="#constructor.detail">Constr</a> | </li> |
| <li><a href="#method.detail">Method</a></li> |
| </ul> |
| </div> |
| <a name="skip.navbar.bottom"> |
| <!-- --> |
| </a></div> |
| <!-- ======== END OF BOTTOM NAVBAR ======= --> |
| <p class="legalCopy"><small>Copyright © 2021 <a href="https://www.apache.org">Apache Software Foundation</a>. All rights reserved.</small></p> |
| </body> |
| </html> |