Examples of bytesize()


Examples of erjang.EBinary.byteSize()

  @BIF
  static ESmall iolist_size(EObject val) {

    EBinary bin;
    if ((bin=val.testBinary()) != null) {
      return new ESmall(bin.byteSize());
    }
   
    EString str;
    if ((str=val.testString()) != null) {
      return new ESmall(str.length());
View Full Code Here

Examples of erjang.EBinary.byteSize()

    {
      EBinary b;
      if ((b = o.testBinary()) == null)
        throw ERT.badarg(o);
     
      return ERT.box(b.byteSize());
    }
    return ERT.box(t.arity());
  }

  @BIF
View Full Code Here

Examples of erjang.EBinary.byteSize()

    if ((t = o.testTuple()) != null)
      return ERT.box(t.arity());

    EBinary b;
    if ((b = o.testBinary()) != null)
      return ERT.box(b.byteSize());
   
    return null;
  }

  @BIF(type = Type.GUARD, name = "size")
View Full Code Here

Examples of erjang.EBinary.byteSize()

      ESmall start1 = start.testSmall();
      if (bin1 == null || start1 == null) {
        return null;
      }
     
      return binary_part_guard(bin, start, ERT.box( bin1.byteSize() - start1.value ));
    }
   
    @BIF(name="binary_part", type=Type.GUARD)
    public static EObject binary_part_guard(EObject bin, EObject start, EObject length) {
      EBinary bin1 = bin.testBinary();
View Full Code Here

Examples of erjang.EBinary.byteSize()

      if (bin1 == null || start1 == null || length == null) {
        return null;
      }
     
      if (start1.value < 0
          || (start1.value + length1.value) > bin1.byteSize()
        || length1.value < 0) {
        return null;
      }
 
      return bin1.substring(start1.value * 8, length1.value * 8);
 
View Full Code Here

Examples of erjang.EBitString.byteSize()

    EBitString b;
    ESmall i;
    if ((b=bin.testBitString()) == null
      || ((i=idx.testSmall()) == null)
      || i.value < 0
      || i.value > b.byteSize()) {
      throw ERT.badarg(bin, idx);
    }

    long split = i.value*8;
    return new ETuple2(b.substring(0, split),
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.output.IObjectOutput.byteSize()

    assertTrue("must have value changed since a new object",
        objectOutput.isValueChanged(objectAndPersistInfo));
    assertNull("for initial write must not have original value",
        objectAndPersistInfo.originalValue);
    // storageInfo.setHeaderDataSize(offset);
    final int byteSize = objectOutput
        .byteSize(objectAndPersistInfo, offset);
    final byte[] binary = new byte[byteSize];
    // write
    final ObjectClassInfoAndDeclared[] sons = objectOutput
        .writeBody(binary, offset, objectAndPersistInfo, true/* updateOriginalValue */);
 
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.output.IObjectOutput.byteSize()

    final IObjectOutput objectOutput;
    objectOutput = getObjectOutput(classInfo);
    assert !toWrite.isSubstituted();
    objectOutput.prepareWrite(toWrite);

    final int byteSizeForObject = objectOutput.byteSize(toWrite,
        HEADER_DATA_SIZE);
    /*
     * "long byte size" added to length for object and store data record
     * identifier
     */
 
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.output.IObjectOutput.byteSize()

    final ClassInfo classInfo = toWriteObjectAndPersistInfo.objectClassInfo;
    // ASSERTX
    assert classInfo != null && classInfo != ClassInfo.NULL : "class information for object not defined";
    final IObjectOutput objectOutput;
    objectOutput = getObjectOutput(classInfo);
    final int byteSize = objectOutput.byteSize(toWriteObjectAndPersistInfo,
        HEADER_DATA_SIZE);
    final byte[] binary = new byte[byteSize];
    final int offset = headerWriter.write(classInfo, binary);
    if (offset != HEADER_DATA_SIZE) {
      throw new ObjectIOException("header data size missmatch");
View Full Code Here

Examples of net.sf.joafip.store.service.objectio.serialize.output.ObjectOutputSerializable.byteSize()

    assertTrue("must have value changed since a new object",
        objectOutput.isValueChanged(objectAndPersistInfo));
    assertNull("for initial write must not have original value",
        objectAndPersistInfo.originalValue);
    // storageInfo.setHeaderDataSize(offset);
    final int byteSize = objectOutput
        .byteSize(objectAndPersistInfo, offset);
    final byte[] binary = new byte[byteSize];
    // write
    final ObjectClassInfoAndDeclared[] sons = objectOutput
        .writeBody(binary, offset, objectAndPersistInfo, true/* updateOriginalValue */);
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.