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

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


  }

  @Override
  public int readInt() throws IOException {
    final int value;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.integerConverter;
      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 long readLong() throws IOException {
    final long value;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.longConverter;
      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 double readDouble() throws IOException {
    final double value;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.doubleConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new IOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new IOException(VALUE_NOT_DEFINED);
View Full Code Here

    while (offset < binaryLength) {
      int byteSize;
      byteSize = helperBinaryConversion.byteSize(binary[offset]);
      if (helperBinaryConversion.getType(binary[offset]) ==
      /**/HelperBinaryConversion.REFERENCE_TYPE) {
        AbstractConverter binaryConverter;
        try {
          binaryConverter = (AbstractConverter) helperBinaryConversion
              .fromBinary(binary, offset);
        } catch (BinaryConverterException exception) {
          throw new ObjectIOException(exception);
View Full Code Here

   * @throws ObjectIOException
   */
  protected int checkSignature(final byte[] binary,
      final int signatureOffset, final ClassInfo classInfo)
      throws ObjectIOInvalidClassException, ObjectIOException {
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.integerConverter;
      binaryConverter.fromBinary(binary, signatureOffset);
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new ObjectIOException("signature value must be defined");
View Full Code Here

   * @throws ObjectIOException
   */
  protected int checkStaticFieldSignature(final byte[] binary,
      final int signatureOffset, final ClassInfo classInfo)
      throws ObjectIOInvalidClassException, ObjectIOException {
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.integerConverter;
      binaryConverter.fromBinary(binary, signatureOffset);
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new ObjectIOException("signature value must be defined");
View Full Code Here

    assert arrayTypeInfo.isArrayType() : "must be array type";
    // int offset = super.checkSignature(binary, bodyBeginOffset,
    // arrayTypeInfo, false, false);
    // skip signature
    int offset = bodyBeginOffset + HelperBinaryConversion.INT_BYTE_SIZE;
    AbstractConverter binaryConverter;
    try {
      binaryConverter = helperBinaryConversion.integerConverter;
      binaryConverter.fromBinary(binary, offset);
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
    }
    if (!binaryConverter.valueDefinedFromBinary) {
      throw new ObjectIOException("array length value must be defined");
View Full Code Here

    int offset = beginOffset;
    // final int byteSize =
    // helperBinaryConversion.byteSize(recordElementType);
    final int byteSize = recordElementType.getBinarySize();
    for (int index = 0; index < arrayLength; index++) {
      AbstractConverter binaryConverter;
      try {
        binaryConverter = (AbstractConverter) helperBinaryConversion
            .fromBinary(binary, offset, recordElementType);
      } catch (BinaryConverterException exception) {
        throw new ObjectIOException(exception);
View Full Code Here

  @Override
  final protected ObjectAndPersistInfo createReadingBody(final byte[] binary,
      final int bodyBeginOffset, final ClassInfo classInfo,
      final DataRecordIdentifier dataRecordIdentifier)
      throws ObjectIOException, ObjectIODataCorruptedException {
    AbstractConverter binaryConverter;
    try {
      binaryConverter = (AbstractConverter) helperBinaryConversion
          .fromBinary(binary, bodyBeginOffset, classInfo);
    } catch (BinaryConverterException exception) {
      throw new ObjectIOException(exception);
View Full Code Here

  private int readEnumConstantName(final byte[] binary, final int offset)
      throws ObjectIOException {
    int localOffset = offset;
    final char[] charArray;
    try {
      AbstractConverter binaryConverter;
      binaryConverter = helperBinaryConversion.integerConverter;
      binaryConverter.fromBinary(binary, localOffset);
      if (!binaryConverter.valueDefinedFromBinary) {
        throw new ObjectIOException(
            "char array length value must be defined");
      }
      final int charArrayLength = (Integer) binaryConverter.objectFromBinary;
      binaryConverter.objectFromBinary = null;// NOPMD
      localOffset += HelperBinaryConversion.INT_BYTE_SIZE;
      charArray = new char[charArrayLength];
      binaryConverter = helperBinaryConversion.characterConverter;
      for (int index = 0; index < charArrayLength; index++) {
        binaryConverter.fromBinary(binary, localOffset);
        if (!binaryConverter.valueDefinedFromBinary) {
          throw new ObjectIOException("char value must be defined");
        }
        charArray[index] = ((Character) binaryConverter.objectFromBinary)
            .charValue();
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.