Tabnine Logo
ByteIterator.next
Code IndexAdd Tabnine to your IDE (free)

How to use
next
method
in
org.wildfly.security.util.ByteIterator

Best Java code snippets using org.wildfly.security.util.ByteIterator.next (Showing top 20 results out of 315)

origin: wildfly/wildfly

public int getPackedBE32() throws NoSuchElementException {
  int v = next();
  int t = 0;
  while ((v & 0x80) != 0) {
    t = t << 7 | v & 0x7f;
    v = next();
  }
  t = t << 7 | v;
  return t;
}
origin: wildfly/wildfly

public long getPackedBE64() throws NoSuchElementException {
  int v = next();
  long t = 0;
  while ((v & 0x80) != 0) {
    t = t << 7 | (long)(v & 0x7f);
    v = next();
  }
  t = t << 7 | v;
  return t;
}
origin: wildfly/wildfly

public int next() {
  return ByteIterator.this.next();
}
origin: wildfly/wildfly

public int next() throws NoSuchElementException {
  return table[ByteIterator.this.next()] & 0xff;
}
origin: wildfly/wildfly

public int getBE16() throws NoSuchElementException {
  return next() << 8 | next();
}
origin: wildfly/wildfly

public int next() throws NoSuchElementException {
  return table[ByteIterator.this.next()] & 0xff;
}
origin: wildfly/wildfly

public long getBE64() throws NoSuchElementException {
  return (long)next() << 56 | (long)next() << 48 | (long)next() << 40 | (long)next() << 32 | (long)next() << 24 | (long)next() << 16 | (long)next() << 8 | (long)next();
}
origin: wildfly/wildfly

public int getBE32() throws NoSuchElementException {
  return next() << 24 | next() << 16 | next() << 8 | next();
}
origin: wildfly/wildfly

public int next() {
  if (offset == size) {
    throw new NoSuchElementException();
  }
  offset ++;
  return ByteIterator.this.next();
}
origin: wildfly/wildfly

/**
 * Drain all the remaining bytes in this iterator to the given stream.
 *
 * @param stream the stream
 * @return the same stream
 */
public ByteArrayOutputStream drainTo(ByteArrayOutputStream stream) {
  while (hasNext()) {
    stream.write(next());
  }
  return stream;
}
origin: wildfly/wildfly

public int read() throws IOException {
  return hasNext() ? next() : -1;
}
origin: wildfly/wildfly

/**
 * Drains up to {@code len} bytes from this iterator into the given {@code dst} array.
 * An attempt is made to drain as many as {@code len} bytes, but a smaller number may
 * be drained.
 * <p>
 * The number of bytes actually drained is returned as an integer. Unlike
 * {@link InputStream#read(byte[], int, int)}, this method never returns a negative result.
 *
 * @param dst the buffer into which the data is drained
 * @param offs the start offset in array {@code dst} at which the data is written.
 * @param len the maximum number of bytes to drain
 * @return the total number of bytes drained into {@code dst}, always greater or equal to {@code 0}
 */
public int drain(byte[] dst, int offs, int len) {
  for (int i = 0; i < len; i ++) {
    if (! hasNext()) return i;
    dst[offs + i] = (byte) next();
  }
  return len;
}
origin: wildfly/wildfly

public int next() {
  int n = ByteIterator.this.peekNext();
  if (isDelim(n)) {
    current = -1;
    throw new NoSuchElementException();
  }
  offset ++;
  return current = ByteIterator.this.next();
}
origin: wildfly/wildfly

/**
 * Determine if the remaining contents of this iterator are identical to the remaining contents of the other iterator.  If the
 * contents are not equal, the iterators will be positioned at the location of the first difference.  If the contents
 * are equal, the iterators will both be positioned at the end of their contents.
 *
 * @param other the other byte iterator
 * @return {@code true} if the contents are equal, {@code false} otherwise
 */
public final boolean contentEquals(ByteIterator other) {
  for (;;) {
    if (hasNext()) {
      if (! other.hasNext()) {
        return false;
      }
      if (next() != other.next()) {
        return false;
      }
    } else {
      return ! other.hasNext();
    }
  }
}
origin: wildfly/wildfly

public int next() throws NoSuchElementException {
  if (! hasNext()) throw new NoSuchElementException();
  if (lo) {
    lo = false;
    return hex(b & 0xf);
  } else {
    b = ByteIterator.this.next();
    lo = true;
    return hex(b >> 4);
  }
}
origin: wildfly/wildfly

int result = calc7(ByteIterator.this.peekPrev());
if (state == 9) {
  ByteIterator.this.next();
} else if (state == 0x11) {
  ByteIterator.this.next();
  ByteIterator.this.next();
} else if (state == 0x19) {
  ByteIterator.this.next();
  ByteIterator.this.next();
  ByteIterator.this.next();
} else if (state == 0x21) {
  ByteIterator.this.next();
  ByteIterator.this.next();
  ByteIterator.this.next();
  ByteIterator.this.next();
origin: wildfly/wildfly

case 0: {
  assert ByteIterator.this.hasNext();
  int b0 = ByteIterator.this.next();
  c0 = calc0(b0);
  if (!ByteIterator.this.hasNext()) {
    return c0;
  int b1 = ByteIterator.this.next();
  c1 = calc1(b0, b1);
  if (!ByteIterator.this.hasNext()) {
    return c0;
  int b2 = ByteIterator.this.next();
  c2 = calc2(b1, b2);
  c3 = calc3(b2);
origin: wildfly/wildfly

case 0: {
  assert ByteIterator.this.hasNext();
  int b0 = ByteIterator.this.next();
  c0 = calc0(b0);
  if (!ByteIterator.this.hasNext()) {
    return c0;
  int b1 = ByteIterator.this.next();
  c1 = calc1(b0, b1);
  if (!ByteIterator.this.hasNext()) {
    return c0;
  int b2 = ByteIterator.this.next();
  c2 = calc2(b1, b2);
  c3 = calc3(b2);
origin: wildfly/wildfly

case 0: {
  assert ByteIterator.this.hasNext();
  int b0 = ByteIterator.this.next();
  c0 = calc0(b0);
  if (!ByteIterator.this.hasNext()) {
    return c0;
  int b1 = ByteIterator.this.next();
  c1 = calc1(b0, b1);
  c2 = calc2(b1);
    return c0;
  int b2 = ByteIterator.this.next();
  c3 = calc3(b1, b2);
  if (!ByteIterator.this.hasNext()) {
    return c0;
  int b3 = ByteIterator.this.next();
  c4 = calc4(b2, b3);
  c5 = calc5(b3);
  int b4 = ByteIterator.this.next();
  c6 = calc6(b3, b4);
  c7 = calc7(b4);
origin: wildfly/wildfly

case 0: {
  assert ByteIterator.this.hasNext();
  int b0 = ByteIterator.this.next();
  c0 = calc0(b0);
  if (!ByteIterator.this.hasNext()) {
    return c0;
  int b1 = ByteIterator.this.next();
  c1 = calc1(b0, b1);
  c2 = calc2(b1);
    return c0;
  int b2 = ByteIterator.this.next();
  c3 = calc3(b1, b2);
  if (!ByteIterator.this.hasNext()) {
    return c0;
  int b3 = ByteIterator.this.next();
  c4 = calc4(b2, b3);
  c5 = calc5(b3);
  int b4 = ByteIterator.this.next();
  c6 = calc6(b3, b4);
  c7 = calc7(b4);
org.wildfly.security.utilByteIteratornext

Javadoc

Get the next byte.

Popular methods of ByteIterator

  • asUtf8String
    Get this byte iterator as a UTF-8 string.
  • drain
    Drains up to len bytes from this iterator into the given dst array. An attempt is made to drain as m
  • ofBytes
    Get a byte iterator for a byte array with interleave.
  • appendTo
  • asLatin1String
    Get this byte iterator as a Latin-1 string.
  • base32Encode
    Base32-encode the current stream.
  • base64Encode
    Base64-encode the current stream.
  • drainTo
    Drain all the remaining bytes in this iterator to the given stream.
  • hasNext
    Determine if there are more bytes after the current byte.
  • hasPrev
    Determine if there are more bytes before the current byte.
  • hexEncode
    Hex-encode the current stream.
  • offset
    Get the current offset, in bytes.
  • hexEncode,
  • offset,
  • peekNext,
  • peekPrev,
  • prev,
  • update,
  • hexDecode

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getSystemService (Context)
  • getApplicationContext (Context)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Best IntelliJ 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