public override short get() { if (_position == _limit) { throw new java.nio.BufferUnderflowException(); } return(byteBuffer.getShort(_position++ *libcore.io.SizeOf.SHORT)); }
public RPFHeaderSection(java.nio.ByteBuffer buffer) { this.endianIndicator = ((byte)0 != buffer.get()); // reads 1 byte, 0 for big endian this.headerLength = buffer.getShort(); // reads 2 bytes this.filename = NITFSUtil.getString(buffer, 12); this.updateIndicator = NITFSUtil.getByteAsShort(buffer); // reads 1 byte (short) this.govSpecNumber = NITFSUtil.getString(buffer, 15); this.govSpecDate = NITFSUtil.getString(buffer, 8); this.securityClass = NITFSUtil.getString(buffer, 1); this.securityCountryCode = NITFSUtil.getString(buffer, 2); this.securityReleaseMark = NITFSUtil.getString(buffer, 2); this.locationSectionLocation = buffer.getInt(); // read 4 bytes (int) }
/// <seealso>[Hitchens2002] p.47: Accessing Unsigned Data</seealso> /// <param name="buffer"/> /// <returns/> public static int getUnsignedShort(java.nio.ByteBuffer buffer) { return(buffer.getShort() & unchecked ((int)(0xffff))); }
public static int getUShort(java.nio.ByteBuffer buffer) { return(0xFFFF & buffer.getShort()); }