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

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


  @Override
  final public DataRecordIdentifier[] getReferencedList(final byte[] binary,
      final int offset) throws ObjectIOException {
    /* add int size for signature */
    int localOffset = offset + HelperBinaryConversion.INT_BYTE_SIZE;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.integerConverter;
      binaryConverter.fromBinary(binary, localOffset);
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new ObjectIOException(
View Full Code Here


      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException, ObjectIODataCorruptedException {
    int offset = bodyBeginOffset;
    final char[] charArray;
    try {
      AbstractConverter binaryConverter;
      binaryConverter = helperBinaryConversion.integerConverter;
      binaryConverter.fromBinary(binary, offset);
      if (!binaryConverter.valueDefinedFromBinary) {
        throw new ObjectIOException(
            "array length value must be defined");
      }
      final int charArrayLength = (Integer) binaryConverter.objectFromBinary;
      binaryConverter.objectFromBinary = null;// NOPMD
      offset += HelperBinaryConversion.INT_BYTE_SIZE;
      charArray = new char[charArrayLength];
      binaryConverter = helperBinaryConversion.characterConverter;
      for (int index = 0; index < charArrayLength; index++) {
        binaryConverter.fromBinary(binary, offset);
        if (!binaryConverter.valueDefinedFromBinary) {
          throw new ObjectIOException("char value must be defined");
        }
        charArray[index] = ((Character) binaryConverter.objectFromBinary)
            .charValue();
View Full Code Here

      throws ObjectIOException, ObjectIODataRecordNotFoundException,
      ObjectIOClassNotFoundException, ObjectIOInvalidClassException,
      ObjectIODataCorruptedException, ObjectIONotSerializableException {

    ObjectAndPersistInfo objectAndPersistInfo;
    AbstractConverter fromBinary;
    try {
      fromBinary = helperBinaryConversion.nullableAndTypedReferenceConverter;
      fromBinary.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }
    if (fromBinary.valueDefinedFromBinary) {
      final DataRecordIdentifier identifier = (DataRecordIdentifier)
View Full Code Here

      endOffset = offset + HelperBinaryConversion.NULL_BYTE_SIZE;
      objectAndPersistInfo = ObjectAndPersistInfo.NULL;
      referenceRead = false;

    } else if (typeId == HelperBinaryConversion.REFERENCE_TYPE) {
      AbstractConverter binaryConverter;
      try {
        binaryConverter = helperBinaryConversion.nullableAndTypedReferenceConverter;
        binaryConverter.fromBinary(binary, offset);
      } catch (BinaryConverterException exception) {
        throw new ObjectIOException(exception);
      }
      if (binaryConverter.valueDefinedFromBinary) {
        /*
         * reference
         */
        identifier = (DataRecordIdentifier)
        /**/binaryConverter.objectFromBinary;
        binaryConverter.objectFromBinary = null;// NOPMD
        if (identifier == null) {
          objectAndPersistInfo = ObjectAndPersistInfo.NULL_DEFINED;
        } else {
          objectAndPersistInfo = objectIoManager
              .createObjectReadingInStoreOrGetExisting(
                  identifier, false/* lazy if proxy mode enable */);
        }
        referenceRead = true;
      } else {
        objectAndPersistInfo = ObjectAndPersistInfo.NULL;
        referenceRead = true;
      }
      endOffset = offset
          + HelperBinaryConversion.REFERENCE_NULLABLE_BYTE_SIZE;
    } else {
      /*
       * basic type
       */
      int byteSize;
      byteSize = helperBinaryConversion.byteSize(binary[offset]);
      AbstractConverter binaryConverter;
      try {
        binaryConverter = (AbstractConverter) helperBinaryConversion
            .fromBinary(binary, offset);
      } catch (BinaryConverterException exception) {
        throw new ObjectIOException(exception);
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.