Java Code Examples for com.android.dex.Leb128#writeSignedLeb128()

The following examples show how to use com.android.dex.Leb128#writeSignedLeb128() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ByteArrayAnnotatedOutput.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public int writeSleb128(int value) {
    if (stretchy) {
        ensureCapacity(cursor + 5); // pessimistic
    }
    int cursorBefore = cursor;
    Leb128.writeSignedLeb128(this, value);
    return (cursor - cursorBefore);
}
 
Example 2
Source File: ByteArrayAnnotatedOutput.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public int writeSleb128(int value) {
    if (stretchy) {
        ensureCapacity(cursor + 5); // pessimistic
    }
    int cursorBefore = cursor;
    Leb128.writeSignedLeb128(this, value);
    return (cursor - cursorBefore);
}
 
Example 3
Source File: ByteArrayAnnotatedOutput.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
   @Override
public int writeSleb128(int value) {
       if (stretchy) {
           ensureCapacity(cursor + 5); // pessimistic
       }
       int cursorBefore = cursor;
       Leb128.writeSignedLeb128(this, value);
       return (cursor - cursorBefore);
   }
 
Example 4
Source File: ByteArrayAnnotatedOutput.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
public int writeSleb128(int value) {
    if (stretchy) {
        ensureCapacity(cursor + 5); // pessimistic
    }
    int cursorBefore = cursor;
    Leb128.writeSignedLeb128(this, value);
    return (cursor - cursorBefore);
}
 
Example 5
Source File: Leb128UtilsTest.java    From buck with Apache License 2.0 4 votes vote down vote up
private byte[] encodeSignedLeb(int value) {
    ByteArrayAnnotatedOutput out = new ByteArrayAnnotatedOutput(5);
    Leb128.writeSignedLeb128(out, value);
    return out.toByteArray();
}