1 // automatically generated by the FlatBuffers compiler, do not modify 2 3 import java.nio.* 4 import kotlin.math.sign 5 import com.google.flatbuffers.* 6 7 @Suppress("unused") 8 @ExperimentalUnsignedTypes 9 class Movie : Table() { 10 __initnull11 fun __init(_i: Int, _bb: ByteBuffer) { 12 __reset(_i, _bb) 13 } __assignnull14 fun __assign(_i: Int, _bb: ByteBuffer) : Movie { 15 __init(_i, _bb) 16 return this 17 } 18 val mainCharacterType : UByte 19 get() { 20 val o = __offset(4) 21 return if(o != 0) bb.get(o + bb_pos).toUByte() else 0u 22 } mutateMainCharacterTypenull23 fun mutateMainCharacterType(mainCharacterType: UByte) : Boolean { 24 val o = __offset(4) 25 return if (o != 0) { 26 bb.put(o + bb_pos, mainCharacterType.toByte()) 27 true 28 } else { 29 false 30 } 31 } mainCharacternull32 fun mainCharacter(obj: Table) : Table? { 33 val o = __offset(6); return if (o != 0) __union(obj, o + bb_pos) else null 34 } charactersTypenull35 fun charactersType(j: Int) : UByte { 36 val o = __offset(8) 37 return if (o != 0) { 38 bb.get(__vector(o) + j * 1).toUByte() 39 } else { 40 0u 41 } 42 } 43 val charactersTypeLength : Int 44 get() { 45 val o = __offset(8); return if (o != 0) __vector_len(o) else 0 46 } 47 val charactersTypeAsByteBuffer : ByteBuffer get() = __vector_as_bytebuffer(8, 1) charactersTypeInByteBuffernull48 fun charactersTypeInByteBuffer(_bb: ByteBuffer) : ByteBuffer = __vector_in_bytebuffer(_bb, 8, 1) 49 fun mutateCharactersType(j: Int, charactersType: UByte) : Boolean { 50 val o = __offset(8) 51 return if (o != 0) { 52 bb.put(__vector(o) + j * 1, charactersType.toByte()) 53 true 54 } else { 55 false 56 } 57 } charactersnull58 fun characters(obj: Table, j: Int) : Table? { 59 val o = __offset(10) 60 return if (o != 0) { 61 __union(obj, __vector(o) + j * 4) 62 } else { 63 null 64 } 65 } 66 val charactersLength : Int 67 get() { 68 val o = __offset(10); return if (o != 0) __vector_len(o) else 0 69 } 70 companion object { validateVersionnull71 fun validateVersion() = Constants.FLATBUFFERS_2_0_0() 72 fun getRootAsMovie(_bb: ByteBuffer): Movie = getRootAsMovie(_bb, Movie()) 73 fun getRootAsMovie(_bb: ByteBuffer, obj: Movie): Movie { 74 _bb.order(ByteOrder.LITTLE_ENDIAN) 75 return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)) 76 } MovieBufferHasIdentifiernull77 fun MovieBufferHasIdentifier(_bb: ByteBuffer) : Boolean = __has_identifier(_bb, "MOVI") 78 fun createMovie(builder: FlatBufferBuilder, mainCharacterType: UByte, mainCharacterOffset: Int, charactersTypeOffset: Int, charactersOffset: Int) : Int { 79 builder.startTable(4) 80 addCharacters(builder, charactersOffset) 81 addCharactersType(builder, charactersTypeOffset) 82 addMainCharacter(builder, mainCharacterOffset) 83 addMainCharacterType(builder, mainCharacterType) 84 return endMovie(builder) 85 } startMovienull86 fun startMovie(builder: FlatBufferBuilder) = builder.startTable(4) 87 fun addMainCharacterType(builder: FlatBufferBuilder, mainCharacterType: UByte) = builder.addByte(0, mainCharacterType.toByte(), 0) 88 fun addMainCharacter(builder: FlatBufferBuilder, mainCharacter: Int) = builder.addOffset(1, mainCharacter, 0) 89 fun addCharactersType(builder: FlatBufferBuilder, charactersType: Int) = builder.addOffset(2, charactersType, 0) 90 fun createCharactersTypeVector(builder: FlatBufferBuilder, data: UByteArray) : Int { 91 builder.startVector(1, data.size, 1) 92 for (i in data.size - 1 downTo 0) { 93 builder.addByte(data[i].toByte()) 94 } 95 return builder.endVector() 96 } startCharactersTypeVectornull97 fun startCharactersTypeVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(1, numElems, 1) 98 fun addCharacters(builder: FlatBufferBuilder, characters: Int) = builder.addOffset(3, characters, 0) 99 fun createCharactersVector(builder: FlatBufferBuilder, data: IntArray) : Int { 100 builder.startVector(4, data.size, 4) 101 for (i in data.size - 1 downTo 0) { 102 builder.addOffset(data[i]) 103 } 104 return builder.endVector() 105 } startCharactersVectornull106 fun startCharactersVector(builder: FlatBufferBuilder, numElems: Int) = builder.startVector(4, numElems, 4) 107 fun endMovie(builder: FlatBufferBuilder) : Int { 108 val o = builder.endTable() 109 return o 110 } finishMovieBuffernull111 fun finishMovieBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finish(offset, "MOVI") 112 fun finishSizePrefixedMovieBuffer(builder: FlatBufferBuilder, offset: Int) = builder.finishSizePrefixed(offset, "MOVI") 113 } 114 } 115