public boolean addValuePart ( String name , int size ) throws IOException { if ( INSTANCE_EXISITS ) { throw new IOException ( "A GeneralStroable was already instantiated. You cant further add Value Parts" ) ; } int hash = Arrays . hashCode ( name . getBytes ( ) ) ; int index = valuePartNames . size ( ) ; if ( valueHash2Index . containsKey ( hash ) ) { logger . error ( "A valuePart with the name {} already exists" , name ) ; return false ; } valuePartNames . add ( name ) ; valueHash2Index . put ( hash , index ) ; valueIndex2Hash . add ( hash ) ; valueSizes . add ( size ) ; valueByteOffsets . add ( valueSize ) ; valueSize += size ; return true ; }
Adds a new ValuePart