Tabnine Logo
HexUtil
Code IndexAdd Tabnine to your IDE (free)

How to use
HexUtil
in
com.msgilligan.bitcoinj.json.conversion

Best Java code snippets using com.msgilligan.bitcoinj.json.conversion.HexUtil (Showing top 2 results out of 315)

origin: ConsensusJ/consensusj

/**
 * Get a "raw" transaction (which we map to a bitcoinj transaction)
 * @param txid Transaction ID/hash
 * @return bitcoinj Transaction
 * @throws JsonRpcStatusException JSON RPC status exception
 * @throws IOException network error
 */
public Transaction getRawTransaction(Sha256Hash txid) throws JsonRpcStatusException, IOException {
  String hexEncoded = send("getrawtransaction", txid);
  byte[] raw = HexUtil.hexStringToByteArray(hexEncoded);
  return new Transaction(context.getParams(), raw);
}
origin: ConsensusJ/consensusj

  @Override
  public Block deserialize(JsonParser p, DeserializationContext ctxt) throws IOException, JsonProcessingException {
    JsonToken token = p.getCurrentToken();
    switch (token) {
      case VALUE_STRING:
        try {
          byte[] payload = HexUtil.hexStringToByteArray(p.getValueAsString()); // convert  to hex
          return context.getParams().getDefaultSerializer().makeBlock(payload);
        } catch (ProtocolException e) {
          throw new InvalidFormatException(p, "Invalid Block", p.getValueAsString(), Block.class);
        }
      default:
        return (Block) ctxt.handleUnexpectedToken(Block.class, p);
    }
  }
}
com.msgilligan.bitcoinj.json.conversionHexUtil

Javadoc

Hex string to hex conversion utility class.

Most used methods

  • hexStringToByteArray
    Converts a hex-encoded string into a byte array.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • getApplicationContext (Context)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • BoxLayout (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now