Java tutorial
// // DO NOT MODIFY!!! This file was machine generated. DO NOT MODIFY!!! // // Copyright (c) 2014 Vincent W. Chen. // // This file is part of XJavaB. // // XJavaB is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // XJavaB is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with XJavaB. If not, see <http://www.gnu.org/licenses/>. // package com.noodlewiz.xjavab.ext.record.internal; import java.nio.ByteBuffer; import java.util.List; import com.noodlewiz.xjavab.ext.record.ClientInfo; public class Unpacker { public static com.noodlewiz.xjavab.ext.record.Range8 unpackRange8(final ByteBuffer __xjb_buf) { final short first = com.noodlewiz.xjavab.core.internal.Unpacker.unpackUByte(__xjb_buf); final short last = com.noodlewiz.xjavab.core.internal.Unpacker.unpackUByte(__xjb_buf); return new com.noodlewiz.xjavab.ext.record.Range8(first, last); } public static com.noodlewiz.xjavab.ext.record.Range16 unpackRange16(final ByteBuffer __xjb_buf) { final int first = com.noodlewiz.xjavab.core.internal.Unpacker.unpackUShort(__xjb_buf); final int last = com.noodlewiz.xjavab.core.internal.Unpacker.unpackUShort(__xjb_buf); return new com.noodlewiz.xjavab.ext.record.Range16(first, last); } public static com.noodlewiz.xjavab.ext.record.ExtRange unpackExtRange(final ByteBuffer __xjb_buf) { final com.noodlewiz.xjavab.ext.record.Range8 major = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackRange8(__xjb_buf); final com.noodlewiz.xjavab.ext.record.Range16 minor = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackRange16(__xjb_buf); return new com.noodlewiz.xjavab.ext.record.ExtRange(major, minor); } public static com.noodlewiz.xjavab.ext.record.Range unpackRange(final ByteBuffer __xjb_buf) { final com.noodlewiz.xjavab.ext.record.Range8 coreRequests = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackRange8(__xjb_buf); final com.noodlewiz.xjavab.ext.record.Range8 coreReplies = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackRange8(__xjb_buf); final com.noodlewiz.xjavab.ext.record.ExtRange extRequests = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackExtRange(__xjb_buf); final com.noodlewiz.xjavab.ext.record.ExtRange extReplies = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackExtRange(__xjb_buf); final com.noodlewiz.xjavab.ext.record.Range8 deliveredEvents = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackRange8(__xjb_buf); final com.noodlewiz.xjavab.ext.record.Range8 deviceEvents = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackRange8(__xjb_buf); final com.noodlewiz.xjavab.ext.record.Range8 errors = com.noodlewiz.xjavab.ext.record.internal.Unpacker .unpackRange8(__xjb_buf); final boolean clientStarted = com.noodlewiz.xjavab.core.internal.Unpacker.unpackBool(__xjb_buf); final boolean clientDied = com.noodlewiz.xjavab.core.internal.Unpacker.unpackBool(__xjb_buf); return new com.noodlewiz.xjavab.ext.record.Range(coreRequests, coreReplies, extRequests, extReplies, deliveredEvents, deviceEvents, errors, clientStarted, clientDied); } public static ClientInfo unpackClientInfo(final ByteBuffer __xjb_buf) { final long clientResource = com.noodlewiz.xjavab.core.internal.Unpacker.unpackUInt(__xjb_buf); final long numRanges = com.noodlewiz.xjavab.core.internal.Unpacker.unpackUInt(__xjb_buf); final com.google.common.collect.ImmutableList.Builder<com.noodlewiz.xjavab.ext.record.Range> __xjb_rangesBuilder = new com.google.common.collect.ImmutableList.Builder<com.noodlewiz.xjavab.ext.record.Range>(); for (int __xjb_i = 0; (__xjb_i < numRanges); __xjb_i++) { __xjb_rangesBuilder.add(com.noodlewiz.xjavab.ext.record.internal.Unpacker.unpackRange(__xjb_buf)); } final List<com.noodlewiz.xjavab.ext.record.Range> ranges = __xjb_rangesBuilder.build(); return new ClientInfo(clientResource, numRanges, ranges); } }