Skip to content

Instantly share code, notes, and snippets.

@wesm
Created January 20, 2017 14:43
Show Gist options
  • Save wesm/3a9c2106b3a3634d8af1e6e66260836f to your computer and use it in GitHub Desktop.
Save wesm/3a9c2106b3a3634d8af1e6e66260836f to your computer and use it in GitHub Desktop.
// automatically generated, do not modify
package org.apache.arrow.flatbuf;
import java.nio.*;
import java.lang.*;
import java.util.*;
import com.google.flatbuffers.*;
@SuppressWarnings("unused")
public final class Message extends Table {
public static Message getRootAsMessage(ByteBuffer _bb) { return getRootAsMessage(_bb, new Message()); }
public static Message getRootAsMessage(ByteBuffer _bb, Message obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__init(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
public Message __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
public short version() { int o = __offset(4); return o != 0 ? bb.getShort(o + bb_pos) : 0; }
public byte headerType() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) : 0; }
public Table header(Table obj) { int o = __offset(8); return o != 0 ? __union(obj, o) : null; }
public long bodyLength() { int o = __offset(10); return o != 0 ? bb.getLong(o + bb_pos) : 0; }
public static int createMessage(FlatBufferBuilder builder,
short version,
byte header_type,
int header,
long bodyLength) {
builder.startObject(4);
Message.addBodyLength(builder, bodyLength);
Message.addHeader(builder, header);
Message.addVersion(builder, version);
Message.addHeaderType(builder, header_type);
return Message.endMessage(builder);
}
public static void startMessage(FlatBufferBuilder builder) { builder.startObject(4); }
public static void addVersion(FlatBufferBuilder builder, short version) { builder.addShort(0, version, 0); }
public static void addHeaderType(FlatBufferBuilder builder, byte headerType) { builder.addByte(1, headerType, 0); }
public static void addHeader(FlatBufferBuilder builder, int headerOffset) { builder.addOffset(2, headerOffset, 0); }
public static void addBodyLength(FlatBufferBuilder builder, long bodyLength) { builder.addLong(3, bodyLength, 0); }
public static int endMessage(FlatBufferBuilder builder) {
int o = builder.endObject();
return o;
}
public static void finishMessageBuffer(FlatBufferBuilder builder, int offset) { builder.finish(offset); }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment