mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2024-11-19 18:00:39 +01:00
VarInt: simplify encode()
This commit is contained in:
parent
3746516859
commit
2aa764d403
@ -150,9 +150,8 @@ public class VarInt {
|
||||
* @return the minimal encoded bytes of the value
|
||||
*/
|
||||
public byte[] encode() {
|
||||
byte[] bytes = new byte[sizeOf(value)];
|
||||
write(ByteBuffer.wrap(bytes));
|
||||
return bytes;
|
||||
ByteBuffer buf = ByteBuffer.allocate(sizeOf(value));
|
||||
return write(buf).array();
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user