int parse ( final IntBuffer buff , final int start ) { int pos = start ; byte [ ] bytes = NumberFacility . getBytes ( buff . get ( pos ) ) ; type = AceType . parseValue ( bytes [ 0 ] ) ; flags = AceFlag . parseValue ( bytes [ 1 ] ) ; int size = NumberFacility . getInt ( bytes [ 3 ] , bytes [ 2 ] ) ; pos ++ ; rights = AceRights . parseValue ( NumberFacility . getReverseInt ( buff . get ( pos ) ) ) ; if ( type == AceType . ACCESS_ALLOWED_OBJECT_ACE_TYPE || type == AceType . ACCESS_DENIED_OBJECT_ACE_TYPE ) { pos ++ ; objectFlags = AceObjectFlags . parseValue ( NumberFacility . getReverseInt ( buff . get ( pos ) ) ) ; if ( objectFlags . getFlags ( ) . contains ( AceObjectFlags . Flag . ACE_OBJECT_TYPE_PRESENT ) ) { objectType = new byte [ 16 ] ; for ( int j = 0 ; j < 4 ; j ++ ) { pos ++ ; System . arraycopy ( NumberFacility . getBytes ( buff . get ( pos ) ) , 0 , objectType , j * 4 , 4 ) ; } } if ( objectFlags . getFlags ( ) . contains ( AceObjectFlags . Flag . ACE_INHERITED_OBJECT_TYPE_PRESENT ) ) { inheritedObjectType = new byte [ 16 ] ; for ( int j = 0 ; j < 4 ; j ++ ) { pos ++ ; System . arraycopy ( NumberFacility . getBytes ( buff . get ( pos ) ) , 0 , inheritedObjectType , j * 4 , 4 ) ; } } } pos ++ ; sid = new SID ( ) ; pos = sid . parse ( buff , pos ) ; int lastPos = start + ( size / 4 ) - 1 ; applicationData = new byte [ 4 * ( lastPos - pos ) ] ; int index = 0 ; while ( pos < lastPos ) { pos ++ ; System . arraycopy ( NumberFacility . getBytes ( buff . get ( pos ) ) , 0 , applicationData , index , 4 ) ; index += 4 ; } return pos ; }
Load the ACE from the buffer returning the last ACE segment position into the buffer .