// Path: src/main/java/commandwrappers/CommandBlockWrapper.java
// public class CommandBlockWrapper extends CommandWrapper
// {
//     private int dCBWSignature;
//     private int dCBWTag;
//     private int dCBWDataLength;
//     private byte bmCBWFlags;
//     private byte bCBWLUN;
//     private byte bCBWCBLength;
//     private byte[] commandBlock;
// 
// 
//     public CommandBlockWrapper(int dCBWSignature, int dCBWTag, int dCBWDataLength,
//                                byte bmCBWFlags, byte bCBWLUN, byte bCBWCBLength)
//     {
//         this.dCBWSignature = dCBWSignature;
//         this.dCBWTag = dCBWTag;
//         this.dCBWDataLength = dCBWDataLength;
//         this.bmCBWFlags = bmCBWFlags;
//         this.bCBWLUN = bCBWLUN;
//         this.bCBWCBLength = bCBWCBLength;
//     }
// 
//     public CommandBlockWrapper( int dCBWDataLength,
//                                 byte bmCBWFlags, byte bCBWLUN, byte bCBWCBLength)
//     {
//         this.dCBWSignature = CommandWrapper.CBW_SIGNATURE;
//         this.dCBWTag = generateTag();
//         this.dCBWDataLength = dCBWDataLength;
//         this.bmCBWFlags = bmCBWFlags;
//         this.bCBWLUN = bCBWLUN;
//         this.bCBWCBLength = bCBWCBLength;
//     }
// 
//     public void setCommandBlock(byte[] commandBlock)
//     {
//         this.commandBlock = commandBlock;
//     }
// 
//     public int getdCBWDataLength()
//     {
//         return dCBWDataLength;
//     }
// 
//     public int generateTag()
//     {
//         Random random = new Random();
//         return random.nextInt();
//     }
// 
//     @Override
//     public byte[] getCWBuffer()
//     {
//         ByteBuffer buffer = ByteBuffer.allocate(CBW_SIZE);
//         buffer.putInt(EndianessUtil.swapEndianess(dCBWSignature));
//         buffer.putInt(dCBWTag);
//         buffer.putInt(EndianessUtil.swapEndianess(dCBWDataLength));
//         buffer.put(bmCBWFlags);
//         buffer.put(bCBWLUN);
//         buffer.put(bCBWCBLength);
//         buffer.put(commandBlock);
//         return buffer.array();
//     }
// }


import java.nio.ByteBuffer;
import commandwrappers.CommandBlockWrapper;
                break;
            case 6:
                firstByte |= (1 << 7);
                firstByte |= (1 << 6);
                firstByte &= ~(1 << 5);
                break;
            case 7:
                firstByte |= (1 << 7);
                firstByte |= (1 << 6);
                firstByte |= (1 << 5);
                break;
        }

        if(dpo)
            firstByte |= (1 << 4);
        if(fua)
            firstByte |= (1 << 3);
        if(fuaNv)
            firstByte |= (1 << 1);

        buffer.put(firstByte);
        buffer.putInt(logicalBlockAddress);

        buffer.put(convertToByte(groupNumber, 1));
        buffer.put(convertToByte(transferLength, 2));
        buffer.put(control);
        return buffer.array();
    }

    @Override
// Path: src/main/java/commandwrappers/CommandBlockWrapper.java
// public class CommandBlockWrapper extends CommandWrapper
// {
//     private int dCBWSignature;
//     private int dCBWTag;
//     private int dCBWDataLength;
//     private byte bmCBWFlags;
//     private byte bCBWLUN;
//     private byte bCBWCBLength;
//     private byte[] commandBlock;
// 
// 
//     public CommandBlockWrapper(int dCBWSignature, int dCBWTag, int dCBWDataLength,
//                                byte bmCBWFlags, byte bCBWLUN, byte bCBWCBLength)
//     {
//         this.dCBWSignature = dCBWSignature;
//         this.dCBWTag = dCBWTag;
//         this.dCBWDataLength = dCBWDataLength;
//         this.bmCBWFlags = bmCBWFlags;
//         this.bCBWLUN = bCBWLUN;
//         this.bCBWCBLength = bCBWCBLength;
//     }
// 
//     public CommandBlockWrapper( int dCBWDataLength,
//                                 byte bmCBWFlags, byte bCBWLUN, byte bCBWCBLength)
//     {
//         this.dCBWSignature = CommandWrapper.CBW_SIGNATURE;
//         this.dCBWTag = generateTag();
//         this.dCBWDataLength = dCBWDataLength;
//         this.bmCBWFlags = bmCBWFlags;
//         this.bCBWLUN = bCBWLUN;
//         this.bCBWCBLength = bCBWCBLength;
//     }
// 
//     public void setCommandBlock(byte[] commandBlock)
//     {
//         this.commandBlock = commandBlock;
//     }
// 
//     public int getdCBWDataLength()
//     {
//         return dCBWDataLength;
//     }
// 
//     public int generateTag()
//     {
//         Random random = new Random();
//         return random.nextInt();
//     }
// 
//     @Override
//     public byte[] getCWBuffer()
//     {
//         ByteBuffer buffer = ByteBuffer.allocate(CBW_SIZE);
//         buffer.putInt(EndianessUtil.swapEndianess(dCBWSignature));
//         buffer.putInt(dCBWTag);
//         buffer.putInt(EndianessUtil.swapEndianess(dCBWDataLength));
//         buffer.put(bmCBWFlags);
//         buffer.put(bCBWLUN);
//         buffer.put(bCBWCBLength);
//         buffer.put(commandBlock);
//         return buffer.array();
//     }
// }


// Path: src/main/java/com/felhr/usbmassstorageforandroid/scsi/SCSIRead10.java
import java.nio.ByteBuffer;
import commandwrappers.CommandBlockWrapper;

                break;
            case 6:
                firstByte |= (1 << 7);
                firstByte |= (1 << 6);
                firstByte &= ~(1 << 5);
                break;
            case 7:
                firstByte |= (1 << 7);
                firstByte |= (1 << 6);
                firstByte |= (1 << 5);
                break;
        }

        if(dpo)
            firstByte |= (1 << 4);
        if(fua)
            firstByte |= (1 << 3);
        if(fuaNv)
            firstByte |= (1 << 1);

        buffer.put(firstByte);
        buffer.putInt(logicalBlockAddress);

        buffer.put(convertToByte(groupNumber, 1));
        buffer.put(convertToByte(transferLength, 2));
        buffer.put(control);
        return buffer.array();
    }

    @Override
    public CommandBlockWrapper getCbw()