예제 #1
0
    @Override
    protected void writeEncodedValue(final Symbol val) {
      final int length = val.length();
      final EncoderImpl encoder = getEncoder();

      for (int i = 0; i < length; i++) {
        encoder.writeRaw((byte) val.charAt(i));
      }
    }
예제 #2
0
  public TypeEncoding<DescribedType> getEncoding(final DescribedType val) {
    TypeEncoding underlyingEncoding =
        _encoder.getType(val.getDescribed()).getEncoding(val.getDescribed());
    TypeEncoding encoding = _encodings.get(underlyingEncoding);
    if (encoding == null) {
      encoding = new DynamicDescribedTypeEncoding(underlyingEncoding);
      _encodings.put(underlyingEncoding, encoding);
    }

    return encoding;
  }
예제 #3
0
 Decimal64Type(final EncoderImpl encoder, final DecoderImpl decoder) {
   _decimal64Encoder = new Decimal64Encoding(encoder, decoder);
   encoder.register(Decimal64.class, this);
   decoder.register(this);
 }
예제 #4
0
 SymbolType(final EncoderImpl encoder, final DecoderImpl decoder) {
   _symbolEncoding = new LongSymbolEncoding(encoder, decoder);
   _shortSymbolEncoding = new ShortSymbolEncoding(encoder, decoder);
   encoder.register(Symbol.class, this);
   decoder.register(this);
 }