Java Array Unpack unpackLE(long aValue, byte[] aBuf, int aOffset)

Here you can find the source of unpackLE(long aValue, byte[] aBuf, int aOffset)

Description

unpack LE

License

Open Source License

Declaration

public static void unpackLE(long aValue, byte[] aBuf, int aOffset) 

Method Source Code

//package com.java2s;
/*//  www .  j  av a2 s  .  c  o m
Password Tracker (PATRA). An application to safely store your passwords.
Copyright (C) 2006-2009  Bruno Ranschaert, S.D.I.-Consulting BVBA.
    
For more information contact: nospam@sdi-consulting.com
Visit our website: http://www.sdi-consulting.com
    
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
    
This program 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 General Public License for more details.
    
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

public class Main {
    public static void unpackLE(long aValue, byte[] aBuf, int aOffset) {
        aBuf[aOffset + 0] = (byte) aValue;
        aValue >>= 8;
        aBuf[aOffset + 1] = (byte) aValue;
        aValue >>= 8;
        aBuf[aOffset + 2] = (byte) aValue;
        aValue >>= 8;
        aBuf[aOffset + 3] = (byte) aValue;
        aValue >>= 8;
        aBuf[aOffset + 4] = (byte) aValue;
        aValue >>= 8;
        aBuf[aOffset + 5] = (byte) aValue;
        aValue >>= 8;
        aBuf[aOffset + 6] = (byte) aValue;
        aValue >>= 8;
        aBuf[aOffset + 7] = (byte) aValue;
    }
}

Related

  1. unpackDie(byte[] bytes)
  2. UnpackFloat(byte[] bytes, float value)
  3. UnpackFloatBuffer(byte[] buffer, long bytes_read, long num_loaded, float[] list)
  4. unpackInt(byte[] data, int offset)
  5. unpackIntegerByWidth(int len, byte[] buf, int offset)
  6. UnpackLittle32(byte[] bytes, int integer)
  7. unpackLittleEndianLong(byte[] bytes)
  8. unpackLong(byte[] arr, int i, int j)
  9. unpackw(int[] sourcearray, int arraypos, int[] data, int num, int b)