Package net.sf.joafip.store.service.binary

Examples of net.sf.joafip.store.service.binary.AbstractConverter


    }
    try {
      if (fieldInfo.isPersisted()) {
        if (fieldType.isPrimitiveType()) {
          /* a primitive field */
          AbstractConverter binaryConverter;
          binaryConverter = (AbstractConverter) helperBinaryConversion
              .fromBinary(binary, offset, fieldType);
          if (!binaryConverter.valueDefinedFromBinary) {
            throw new ObjectIOException(
                "field value must be defined");
          }
          final Object fieldValue = binaryConverter.objectFromBinary;
          binaryConverter.objectFromBinary = null;// NOPMD
          /* primitive not persisted */
          fieldValueAndPersistInfo = objectIOManager
              .getOrCreateObjectPersistInfoOfObject(fieldValue,
                  false, fieldType, Boolean.FALSE);
          // offset += helperBinaryConversion.byteSize(type);
          offset += fieldType.getBinarySize();
        } else if (helperBinaryConversion.getType(binary, offset) ==
        /*       */HelperBinaryConversion.REFERENCE_TYPE) {
          /* a reference field */
          fieldValueAndPersistInfo = referenceInput.fromBinary(
              binary, offset);
          offset += HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;
          if (!fieldValueAndPersistInfo.valueDefined) {
            throw new ObjectIOException(
                "field value must be defined");
          }
        } else {
          /* a basic field */
          AbstractConverter binaryConverter;
          try {
            binaryConverter = (AbstractConverter) helperBinaryConversion
                .fromBinary(binary, offset);
          } catch (BinaryConverterException exception) {
            throw new ObjectIOException(exception);
View Full Code Here


    if (logger.debugEnabled) {
      logger.debug("read field at offset " + offset);
    }
    if (fieldInfo.isPersisted()) {
      if (fieldType.isBasicOrPrimitiveType()) {
        AbstractConverter binaryConverter;
        try {
          binaryConverter = helperBinaryConversion.fromBinary(binary,
              offset, fieldType);
        } catch (BinaryConverterException exception) {
          throw new ObjectIOException(exception);
View Full Code Here

  }

  @Override
  public int read() throws IOException {
    final int byteValue;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.byteConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

  }

  @Override
  public boolean readBoolean() throws IOException {
    final boolean value;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.booleanConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

  }

  @Override
  public byte readByte() throws IOException {
    final byte value;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.byteConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

  }

  @Override
  public int readUnsignedByte() throws IOException {
    final int byteValue;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.byteConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

  }

  @Override
  public char readChar() throws IOException {
    final char value;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.characterConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

  }

  @Override
  public short readShort() throws IOException {
    final short value;
    final AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.shortConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

  }

  @Override
  public int readUnsignedShort() throws IOException {
    final int value;
    final AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.shortConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

  }

  @Override
  public float readFloat() throws IOException {
    final float value;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.floatConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

TOP

Related Classes of net.sf.joafip.store.service.binary.AbstractConverter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.