Tabnine Logo
GamePacketReader.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
org.apollo.net.codec.game.GamePacketReader

Best Java code snippets using org.apollo.net.codec.game.GamePacketReader.get (Showing top 2 results out of 315)

origin: apollo-rsps/apollo

/**
 * Gets an unsigned data type from the buffer with the specified order and transformation.
 *
 * @param type The data type.
 * @param order The byte order.
 * @param transformation The data transformation.
 * @return The value.
 * @throws IllegalStateException If this reader is not in byte access mode.
 * @throws IllegalArgumentException If the combination is invalid.
 */
public long getUnsigned(DataType type, DataOrder order, DataTransformation transformation) {
  long longValue = get(type, order, transformation);
  Preconditions.checkArgument(type != DataType.LONG, "Longs must be read as a signed type.");
  return longValue & 0xFFFFFFFFFFFFFFFFL;
}
origin: apollo-rsps/apollo

/**
 * Gets a signed data type from the buffer with the specified order and transformation.
 *
 * @param type The data type.
 * @param order The byte order.
 * @param transformation The data transformation.
 * @return The value.
 * @throws IllegalStateException If this reader is not in byte access mode.
 * @throws IllegalArgumentException If the combination is invalid.
 */
public long getSigned(DataType type, DataOrder order, DataTransformation transformation) {
  long longValue = get(type, order, transformation);
  if (type != DataType.LONG) {
    int max = (int) (Math.pow(2, type.getBytes() * 8 - 1) - 1);
    if (longValue > max) {
      longValue -= (max + 1) * 2;
    }
  }
  return longValue;
}
org.apollo.net.codec.gameGamePacketReaderget

Javadoc

Reads a standard data type from the buffer with the specified order and transformation.

Popular methods of GamePacketReader

  • getBytesReverse
    Gets bytes in reverse.
  • getSigned
    Gets a signed data type from the buffer with the specified transformation.
  • getUnsigned
    Gets an unsigned data type from the buffer with the specified transformation.
  • <init>
    Creates the reader.
  • checkBitAccess
    Checks that this reader is in the bit access mode.
  • checkByteAccess
    Checks that this reader is in the byte access mode.
  • getBits
    Gets the specified amount of bits from the buffer.
  • getBytes
    Gets bytes.
  • getLength
    Gets the length of this reader.
  • getString
    Gets a string from the buffer.

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • 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