org.eclipse.store.storage.restadapter.types.ValueReaderReference Maven / Gradle / Ivy
package org.eclipse.store.storage.restadapter.types;
/*-
* #%L
* EclipseStore Storage REST Adapter
* %%
* Copyright (C) 2023 MicroStream Software
* %%
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
* #L%
*/
import org.eclipse.serializer.persistence.binary.types.Binary;
public class ValueReaderReference implements ValueReader
{
///////////////////////////////////////////////////////////////////////////
// constructors //
/////////////////
public ValueReaderReference()
{
super();
}
///////////////////////////////////////////////////////////////////////////
// methods //
////////////
@Override
public Object readValue(final Binary binary, final long address)
{
return new ObjectReferenceWrapper(ViewerBinaryPrimitivesReader.readReference(binary, address));
}
@Override
public long getBinarySize(final Binary binary, final long address)
{
return Binary.objectIdByteLength();
}
}