Codota Logo
uk.co.real_logic.sbe
Code IndexAdd Codota to your IDE (free)

How to use uk.co.real_logic.sbe

Best Java code snippets using uk.co.real_logic.sbe (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
OutputStreamWriter o =
  • Codota IconOutputStream out;new OutputStreamWriter(out)
  • Codota IconOutputStream out;String charsetName;new OutputStreamWriter(out, charsetName)
  • Codota IconHttpURLConnection connection;new OutputStreamWriter(connection.getOutputStream())
  • Smart code suggestions by Codota
}
origin: real-logic/simple-binary-encoding

PrimitiveType(
  final String name, final int size, final double minValue, final double maxValue, final double nullValue)
{
  this.name = name;
  this.size = size;
  this.minValue = new PrimitiveValue(minValue, size);
  this.maxValue = new PrimitiveValue(maxValue, size);
  this.nullValue = new PrimitiveValue(nullValue, size);
}
origin: real-logic/simple-binary-encoding

public static void main(final String[] args)
{
  for (int i = 0; i < 10; i++)
  {
    perfTestEncode(i);
    perfTestDecode(i);
  }
}
origin: real-logic/simple-binary-encoding

public static void main(final String[] args)
{
  for (int i = 0; i < 10; i++)
  {
    perfTestEncode(i);
    perfTestDecode(i);
  }
}
origin: real-logic/simple-binary-encoding

private boolean isRepresentableByInt32(final Encoding encoding)
{
  // These min and max values are the same in .NET
  return encoding.applicableMinValue().longValue() >= Integer.MIN_VALUE &&
    encoding.applicableMaxValue().longValue() <= Integer.MAX_VALUE;
}
origin: real-logic/simple-binary-encoding

private static int sizeOfPrimitive(final Encoding encoding)
{
  return encoding.primitiveType().size();
}
origin: real-logic/simple-binary-encoding

@Test
public void shouldHandleBasicFile()
  throws Exception
{
  parse(TestUtil.getLocalResource("basic-schema.xml"), ParserOptions.DEFAULT);
}
origin: real-logic/simple-binary-encoding

/**
 * The encodedLength (in octets) of the encodingType
 *
 * @return encodedLength of the encodingType
 */
public int encodedLength()
{
  if (presence() == Presence.CONSTANT)
  {
    return 0;
  }
  return encodingType.size();
}
origin: real-logic/simple-binary-encoding

/**
 * The encodedLength (in octets) of the encodingType
 *
 * @return encodedLength of the encodingType
 */
public int encodedLength()
{
  return encodingType.size();
}
origin: real-logic/simple-binary-encoding

/**
 * Return byte array value for this PrimitiveValue.
 *
 * @return value expressed as a byte array
 * @throws IllegalStateException if not a byte array value representation
 */
public byte[] byteArrayValue()
{
  if (representation != Representation.BYTE_ARRAY)
  {
    throw new IllegalStateException(
      "Not a byte[] representation: representation=" + representation + " value=" + toString());
  }
  return byteArrayValue;
}
origin: real-logic/simple-binary-encoding

/**
 * The most applicable max value for the encoded type.
 *
 * @return most applicable max value for the encoded type.
 */
public PrimitiveValue applicableMaxValue()
{
  if (null != maxValue)
  {
    return maxValue;
  }
  return primitiveType.maxValue();
}
origin: real-logic/simple-binary-encoding

/**
 * The most applicable min value for the encoded type.
 *
 * @return most applicable min value for the encoded type.
 */
public PrimitiveValue applicableMinValue()
{
  if (null != minValue)
  {
    return minValue;
  }
  return primitiveType.minValue();
}
origin: real-logic/simple-binary-encoding

/**
 * The most applicable null value for the encoded type.
 *
 * @return most applicable null value for the encoded type.
 */
public PrimitiveValue applicableNullValue()
{
  if (null != nullValue)
  {
    return nullValue;
  }
  return primitiveType.nullValue();
}
origin: real-logic/simple-binary-encoding

/**
 * The number of encoded primitives in this type.
 *
 * @return number of encoded primitives in this type.
 */
public int arrayLength()
{
  if (null == encoding.primitiveType() || 0 == encodedLength)
  {
    return 0;
  }
  return encodedLength / encoding.primitiveType().size();
}
origin: real-logic/simple-binary-encoding

  @Test
  public void shouldHandleEmbeddedLengthForData()
    throws Exception
  {
    parse(TestUtil.getLocalResource("embedded-length-and-count-schema.xml"), ParserOptions.DEFAULT);
    /* should parse correctly */
  }
}
origin: real-logic/simple-binary-encoding

/**
 * Return the Cpp98 formatted byte order encoding string to use for a given byte order and primitiveType
 *
 * @param byteOrder     of the {@link uk.co.real_logic.sbe.ir.Token}
 * @param primitiveType of the {@link uk.co.real_logic.sbe.ir.Token}
 * @return the string formatted as the byte ordering encoding
 */
public static String formatByteOrderEncoding(final ByteOrder byteOrder, final PrimitiveType primitiveType)
{
  switch (primitiveType.size())
  {
    case 2:
      return "SBE_" + byteOrder + "_ENCODE_16";
    case 4:
      return "SBE_" + byteOrder + "_ENCODE_32";
    case 8:
      return "SBE_" + byteOrder + "_ENCODE_64";
    default:
      return "";
  }
}
origin: real-logic/simple-binary-encoding

/**
 * Return double value for this PrimitiveValue.
 *
 * @return value expressed as a double
 * @throws IllegalStateException if not a double value representation
 */
public double doubleValue()
{
  if (representation != Representation.DOUBLE)
  {
    throw new IllegalStateException(
      "Not a double representation: representation=" + representation + " value=" + toString());
  }
  return doubleValue;
}
origin: real-logic/simple-binary-encoding

PrimitiveType(final String name, final int size, final long minValue, final long maxValue, final long nullValue)
{
  this.name = name;
  this.size = size;
  this.minValue = new PrimitiveValue(minValue, size);
  this.maxValue = new PrimitiveValue(maxValue, size);
  this.nullValue = new PrimitiveValue(nullValue, size);
}
origin: real-logic/simple-binary-encoding

@Test
public void shouldHandleBasicFileWithVariableLengthData()
  throws Exception
{
  parse(TestUtil.getLocalResource("basic-variable-length-schema.xml"), ParserOptions.DEFAULT);
}
origin: real-logic/simple-binary-encoding

/**
 * Return the Golang formatted byte order encoding string to use for a given byte order and primitiveType
 *
 * @param byteOrder     of the {@link uk.co.real_logic.sbe.ir.Token}
 * @param primitiveType of the {@link uk.co.real_logic.sbe.ir.Token}
 * @return the string formatted as the byte ordering encoding
 */
public static String formatByteOrderEncoding(final ByteOrder byteOrder, final PrimitiveType primitiveType)
{
  switch (primitiveType.size())
  {
    case 2:
      return "binary.Write(buf, order, obj)";
    case 4:
      return "binary.Write(buf, order, obj)";
    case 8:
      return "binary.Write(buf, order, obj)";
    default:
      return "";
  }
}
origin: real-logic/simple-binary-encoding

/**
 * Return long value for this PrimitiveValue
 *
 * @return value expressed as a long
 * @throws IllegalStateException if not a long value representation
 */
public long longValue()
{
  if (representation != Representation.LONG)
  {
    throw new IllegalStateException(
      "Not a long representation: representation=" + representation + " value=" + toString());
  }
  return longValue;
}
uk.co.real_logic.sbe

Most used classes

  • Ir
    Intermediate representation of SBE messages to be used for the generation of encoders and decoders a
  • IrDecoder
  • IrEncoder
  • Token
    Class to encapsulate a token of information for the message schema stream. This Intermediate Represe
  • JsonPrinter
    Pretty Print Json based upon the given Ir.
  • IrGenerator,
  • XmlSchemaParser,
  • PrimitiveValue,
  • Encoding,
  • OtfHeaderDecoder,
  • PrimitiveType,
  • SbeTool,
  • CodeGenerator,
  • CSharpGenerator,
  • JavaGenerator,
  • JavaUtil,
  • Encoding$Builder,
  • HeaderStructure,
  • MessageHeaderDecoder
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now