com.refinitiv.ema.access.OmmBufferImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ema Show documentation
Show all versions of ema Show documentation
Enterprise Message API (EMA) Java Edition
///*|-----------------------------------------------------------------------------
// *| This source code is provided under the Apache 2.0 license --
// *| and is provided AS IS with no warranty or guarantee of fit for purpose. --
// *| See the project's LICENSE.md for details. --
// *| Copyright (C) 2019 Refinitiv. All rights reserved. --
///*|-----------------------------------------------------------------------------
package com.refinitiv.ema.access;
import java.nio.ByteBuffer;
import com.refinitiv.ema.access.EmaUtility;
import com.refinitiv.eta.codec.CodecReturnCodes;
class OmmBufferImpl extends DataImpl implements OmmBuffer
{
OmmBufferImpl()
{
_rsslBuffer = com.refinitiv.eta.codec.CodecFactory.createBuffer();
}
@Override
public int dataType()
{
return DataType.DataTypes.BUFFER;
}
@Override
public ByteBuffer buffer()
{
return asHex();
}
@Override
public String toString()
{
if (code() == DataCode.BLANK)
return BLANK_STRING;
return EmaUtility.asHexString(asHex());
}
@Override
void decode(com.refinitiv.eta.codec.Buffer rsslBuffer, com.refinitiv.eta.codec.DecodeIterator dIter)
{
if (_rsslBuffer.decode(dIter) == CodecReturnCodes.SUCCESS)
_dataCode = DataCode.NO_CODE;
else
_dataCode = DataCode.BLANK;
}
}