Package org.luaj.vm2

Examples of org.luaj.vm2.LuaString.copyInto()


        return null;
      if ( targetType == TARGET_TYPE_STRING )
        return value.tojstring();
      LuaString s = value.checkstring();
      byte[] b = new byte[s.m_length];
      s.copyInto(0, b, 0, b.length);
      return b;
    }
  }

  static final class ArrayCoercion implements Coercion {
View Full Code Here


    LuaString s = args.checkstring( 1 );
    int n = args.checkint( 2 );
    final byte[] bytes = new byte[ s.length() * n ];
    int len = s.length();
    for ( int offset = 0; offset < bytes.length; offset += len ) {
      s.copyInto( 0, bytes, offset, len );
    }
    return LuaString.valueOf( bytes );
  }

  /**
 
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.