Tabnine Logo
ByteArrayDataInputStream.readShort
Code IndexAdd Tabnine to your IDE (free)

How to use
readShort
method
in
org.jgroups.util.ByteArrayDataInputStream

Best Java code snippets using org.jgroups.util.ByteArrayDataInputStream.readShort (Showing top 4 results out of 315)

origin: wildfly/wildfly

protected static Message readMessage(byte[] buf, int offset, int length) throws Exception {
  ByteArrayDataInputStream in=new ByteArrayDataInputStream(buf, offset, length);
  short ver=in.readShort();
  byte flags=in.readByte();
  // final boolean multicast=(flags & (byte)2) == (byte)2;
  Message msg=new Message(false); // don't create headers, readFrom() will do this
  msg.readFrom(in);
  return msg;
}
origin: wildfly/wildfly

/** Reads the message's contents from an input stream, but skips the buffer and instead returns the
 * position (offset) at which the buffer starts */
public int readFromSkipPayload(ByteArrayDataInputStream in) throws Exception {
  // 1. read the leading byte first
  byte leading=in.readByte();
  // 2. the flags
  flags=in.readShort();
  // 3. dest_addr
  if(Util.isFlagSet(leading, DEST_SET))
    dest_addr=Util.readAddress(in);
  // 4. src_addr
  if(Util.isFlagSet(leading, SRC_SET))
    src_addr=Util.readAddress(in);
  // 5. headers
  int len=in.readShort();
  headers=createHeaders(len);
  for(int i=0; i < len; i++) {
    short id=in.readShort();
    Header hdr=readHeader(in).setProtId(id);
    this.headers[i]=hdr;
  }
  // 6. buf
  if(!Util.isFlagSet(leading, BUF_SET))
    return -1;
  length=in.readInt();
  return in.position();
}
origin: org.jboss.eap/wildfly-client-all

protected static Message readMessage(byte[] buf, int offset, int length) throws Exception {
  ByteArrayDataInputStream in=new ByteArrayDataInputStream(buf, offset, length);
  short ver=in.readShort();
  byte flags=in.readByte();
  // final boolean multicast=(flags & (byte)2) == (byte)2;
  Message msg=new Message(false); // don't create headers, readFrom() will do this
  msg.readFrom(in);
  return msg;
}
origin: org.jboss.eap/wildfly-client-all

/** Reads the message's contents from an input stream, but skips the buffer and instead returns the
 * position (offset) at which the buffer starts */
public int readFromSkipPayload(ByteArrayDataInputStream in) throws Exception {
  // 1. read the leading byte first
  byte leading=in.readByte();
  // 2. the flags
  flags=in.readShort();
  // 3. dest_addr
  if(Util.isFlagSet(leading, DEST_SET))
    dest_addr=Util.readAddress(in);
  // 4. src_addr
  if(Util.isFlagSet(leading, SRC_SET))
    src_addr=Util.readAddress(in);
  // 5. headers
  int len=in.readShort();
  headers=createHeaders(len);
  for(int i=0; i < len; i++) {
    short id=in.readShort();
    Header hdr=readHeader(in).setProtId(id);
    this.headers[i]=hdr;
  }
  // 6. buf
  if(!Util.isFlagSet(leading, BUF_SET))
    return -1;
  length=in.readInt();
  return in.position();
}
org.jgroups.utilByteArrayDataInputStreamreadShort

Popular methods of ByteArrayDataInputStream

  • <init>
  • checkBounds
  • limit
  • position
  • read
  • readByte
  • readFully
  • readInt
  • readLong
  • readUnsignedShort
  • skipBytes
  • skipBytes

Popular in Java

  • Updating database using SQL prepared statement
  • runOnUiThread (Activity)
  • onCreateOptionsMenu (Activity)
  • findViewById (Activity)
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for WebStorm
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