Tabnine Logo
Long.toHexString
Code IndexAdd Tabnine to your IDE (free)

How to use
toHexString
method
in
java.lang.Long

Best Java code snippets using java.lang.Long.toHexString (Showing top 20 results out of 10,206)

origin: skylot/jadx

  @Override
  public String toString() {
    return "pos: 0x" + Long.toHexString(readPos);
  }
}
origin: jenkinsci/jenkins

private String toString(String key, long bit) {
  return key+'='+Long.toHexString(bit);
}
origin: redisson/redisson

  public String toString() {
    return Long.toHexString(val1) + Long.toHexString(val2);
  }
}
origin: apache/zookeeper

/**
 * Creates a valid transaction log file name. 
 * 
 * @param zxid used as a file name suffix (extension)
 * @return file name
 */
public static String makeLogName(long zxid) {
  return FileTxnLog.LOG_FILE_PREFIX + "." + Long.toHexString(zxid);
}
origin: apache/kafka

  private static IllegalArgumentException illegalVarlongException(long value) {
    throw new IllegalArgumentException("Varlong is too long, most significant bit in the 10th byte is set, " +
        "converted value: " + Long.toHexString(value));
  }
}
origin: apache/zookeeper

synchronized void updateProposal(long leader, long zxid, long epoch){
  if(LOG.isDebugEnabled()){
    LOG.debug("Updating proposal: " + leader + " (newleader), 0x"
        + Long.toHexString(zxid) + " (newzxid), " + proposedLeader
        + " (oldleader), 0x" + Long.toHexString(proposedZxid) + " (oldzxid)");
  }
  proposedLeader = leader;
  proposedZxid = zxid;
  proposedEpoch = epoch;
}
origin: netty/netty

  private static void appendHexDumpRowPrefix(StringBuilder dump, int row, int rowStartIndex) {
    if (row < HEXDUMP_ROWPREFIXES.length) {
      dump.append(HEXDUMP_ROWPREFIXES[row]);
    } else {
      dump.append(NEWLINE);
      dump.append(Long.toHexString(rowStartIndex & 0xFFFFFFFFL | 0x100000000L));
      dump.setCharAt(dump.length() - 9, '|');
      dump.append('|');
    }
  }
}
origin: netty/netty

/**
 * Creates a new ephemeral port based on the ID of the specified channel.
 * Note that we prepend an upper-case character so that it never conflicts with
 * the addresses created by a user, which are always lower-cased on construction time.
 */
LocalAddress(Channel channel) {
  StringBuilder buf = new StringBuilder(16);
  buf.append("local:E");
  buf.append(Long.toHexString(channel.hashCode() & 0xFFFFFFFFL | 0x100000000L));
  buf.setCharAt(7, ':');
  id = buf.substring(6);
  strVal = buf.toString();
}
origin: dropwizard/dropwizard

private static String hash(byte[] resource) {
  CRC_32.reset();
  CRC_32.update(resource);
  return Long.toHexString(CRC_32.getValue());
}
origin: skylot/jadx

public void checkPos(long expectedOffset, String error) throws IOException {
  if (getPos() != expectedOffset) {
    throw new IOException(error + ", expected offset: 0x" + Long.toHexString(expectedOffset)
        + ", actual: 0x" + Long.toHexString(getPos()));
  }
}
origin: skylot/jadx

private void throwException(String error, int expected, int actual) throws IOException {
  throw new IOException(error
      + ", expected: 0x" + Integer.toHexString(expected)
      + ", actual: 0x" + Integer.toHexString(actual)
      + ", offset: 0x" + Long.toHexString(getPos()));
}
origin: skylot/jadx

  protected void die(String message) throws IOException {
    throw new IOException("Decode error: " + message
        + ", position: 0x" + Long.toHexString(is.getPos()));
  }
}
origin: redisson/redisson

  private static void appendHexDumpRowPrefix(StringBuilder dump, int row, int rowStartIndex) {
    if (row < HEXDUMP_ROWPREFIXES.length) {
      dump.append(HEXDUMP_ROWPREFIXES[row]);
    } else {
      dump.append(NEWLINE);
      dump.append(Long.toHexString(rowStartIndex & 0xFFFFFFFFL | 0x100000000L));
      dump.setCharAt(dump.length() - 9, '|');
      dump.append('|');
    }
  }
}
origin: apache/zookeeper

public static String getVersionFromFilename(String filename) {
  int i = filename.lastIndexOf('.');
  if(i < 0 || i >= filename.length())
    return null;
  String hexVersion = filename.substring(i + 1);
  try {
    long version = Long.parseLong(hexVersion, 16);
    return Long.toHexString(version);
  } catch (NumberFormatException e) {
    return null;
  }
}
origin: redisson/redisson

/**
 * Creates a new ephemeral port based on the ID of the specified channel.
 * Note that we prepend an upper-case character so that it never conflicts with
 * the addresses created by a user, which are always lower-cased on construction time.
 */
LocalAddress(Channel channel) {
  StringBuilder buf = new StringBuilder(16);
  buf.append("local:E");
  buf.append(Long.toHexString(channel.hashCode() & 0xFFFFFFFFL | 0x100000000L));
  buf.setCharAt(7, ':');
  id = buf.substring(6);
  strVal = buf.toString();
}
origin: stackoverflow.com

File textFile = new File("/path/to/file.txt");
File binaryFile = new File("/path/to/file.bin");
String boundary = Long.toHexString(System.currentTimeMillis()); // Just generate some unique random value.
String CRLF = "\r\n"; // Line separator required by multipart/form-data.
URLConnection connection = new URL(url).openConnection();
origin: apache/zookeeper

public boolean trackSession(long sessionId, int sessionTimeout) {
  boolean tracked =
    globalSessionTracker.trackSession(sessionId, sessionTimeout);
  if (localSessionsEnabled && tracked) {
    // Only do extra logging so we know what kind of session this is
    // if we're supporting both kinds of sessions
    LOG.info("Tracking global session 0x" + Long.toHexString(sessionId));
  }
  return tracked;
}
origin: apache/zookeeper

protected void killSession(long sessionId, long zxid) {
  zkDb.killSession(sessionId, zxid);
  if (LOG.isTraceEnabled()) {
    ZooTrace.logTraceMessage(LOG, ZooTrace.SESSION_TRACE_MASK,
                   "ZooKeeperServer --- killSession: 0x"
        + Long.toHexString(sessionId));
  }
  if (sessionTracker != null) {
    sessionTracker.removeSession(sessionId);
  }
}
origin: spring-projects/spring-framework

@Test
public void parseNumberAsHex() {
  String aByte = "0x" + Integer.toHexString(Byte.valueOf(Byte.MAX_VALUE).intValue());
  String aShort = "0x" + Integer.toHexString(Short.valueOf(Short.MAX_VALUE).intValue());
  String anInteger = "0x" + Integer.toHexString(Integer.MAX_VALUE);
  String aLong = "0x" + Long.toHexString(Long.MAX_VALUE);
  String aReallyBigInt = "FEBD4E677898DFEBFFEE44";
  assertByteEquals(aByte);
  assertShortEquals(aShort);
  assertIntegerEquals(anInteger);
  assertLongEquals(aLong);
  assertEquals("BigInteger did not parse",
      new BigInteger(aReallyBigInt, 16), NumberUtils.parseNumber("0x" + aReallyBigInt, BigInteger.class));
}
origin: prestodb/presto

@BeforeClass
public void setUp()
    throws Exception
{
  tempFile = new TempFile();
  Random random = new Random();
  Iterator<String> iterator = Stream.generate(() -> Long.toHexString(random.nextLong())).limit(POSITION_COUNT).iterator();
  writeOrcFileColumnHive(
      tempFile.getFile(),
      ORC_12,
      createOrcRecordWriter(tempFile.getFile(), ORC_12, ZLIB, javaStringObjectInspector),
      VARCHAR,
      iterator);
}
java.langLongtoHexString

Javadoc

Converts the specified long value into its hexadecimal string representation. The returned string is a concatenation of characters from '0' to '9' and 'a' to 'f'.

Popular methods of Long

  • parseLong
    Parses the string argument as a signed long in the radix specified by the second argument. The chara
  • toString
    Returns a string representation of the first argument in the radix specified by the second argument.
  • valueOf
    Returns a Long object holding the value extracted from the specified String when parsed with the rad
  • longValue
    Returns the value of this Long as a long value.
  • <init>
    Constructs a newly allocated Long object that represents the long value indicated by the String para
  • intValue
    Returns the value of this Long as an int.
  • equals
    Compares this object to the specified object. The result is true if and only if the argument is not
  • hashCode
  • compareTo
    Compares this Long object to another object. If the object is a Long, this function behaves likecomp
  • compare
    Compares two long values numerically. The value returned is identical to what would be returned by:
  • doubleValue
    Returns the value of this Long as a double.
  • decode
    Decodes a String into a Long. Accepts decimal, hexadecimal, and octal numbers given by the following
  • doubleValue,
  • decode,
  • numberOfLeadingZeros,
  • numberOfTrailingZeros,
  • bitCount,
  • signum,
  • reverseBytes,
  • toBinaryString,
  • shortValue

Popular in Java

  • Start an intent from android
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getApplicationContext (Context)
  • runOnUiThread (Activity)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • String (java.lang)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top 12 Jupyter Notebook extensions
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