case BufferType.CROSSED: if ( t.ofsR != 0 ) { mylog ( "write[HEAD] " + t.toBlockString ( t.ofsR, alignment - t.ofsR ) );  ByteBuffer buf = ByteBuffer.allocate ( alignment ); parentApi.read ( t.start, buf ); t.copyTo ( buf, t.ofsR, alignment - t.ofsR );  buf.clear(); parentApi.write ( t.start, buf ); }  if ( t.nB != 0 ) { mylog ( "write[BODY] " + t.toBlockString ( t.start + alignment, t.lB ) );  t.limit ( t.lB ); parentApi.write ( t.start + alignment, src ); t.restore(); }  if ( t.lstR != 0 ) { mylog ( "write[TAIL] " + t.toBlockString ( t.end - alignment, t.lstR ) );  ByteBuffer buf = ByteBuffer.allocate ( alignment ); parentApi.read ( t.end - alignment, buf ); t.copyTo ( buf, 0, t.lstR );  buf.clear(); parentApi.write ( t.end - alignment, buf ); } break;
switch (t.type) { case BufferType.EMPTY: return;
    public void write ( long offset, ByteBuffer src ) 	throws IOException {	BufferType t = new BufferType ( offset, src );		mylog ( "\n" + t );		switch ( t.type ) {	case BufferType.EMPTY:	    return;	case BufferType.CONTAINED:	    {		mylog ( "write[CONT] " + t.toBlockString ( t.ofsR, t.length ) );		//		ByteBuffer buf = ByteBuffer.allocate ( alignment );		parentApi.read ( t.start, buf );		t.copyTo ( buf, t.ofsR, t.length );		//		buf.clear();		parentApi.write ( t.start, buf );	    }	    break;	case BufferType.CROSSED:	    if ( t.ofsR != 0 ) {		mylog ( "write[HEAD] " + t.toBlockString ( t.ofsR, alignment - t.ofsR ) );		//		ByteBuffer buf = ByteBuffer.allocate ( alignment );		parentApi.read ( t.start, buf );		t.copyTo ( buf, t.ofsR, alignment - t.ofsR );		//		buf.clear();		parentApi.write ( t.start, buf );	    }	    //	    if ( t.nB != 0 ) {		mylog ( "write[BODY] " + t.toBlockString ( t.start + alignment, t.lB ) );		//		t.limit ( t.lB );		parentApi.write ( t.start + alignment, src );		t.restore();	    }	    //	    if ( t.lstR != 0 ) {		mylog ( "write[TAIL] " + t.toBlockString ( t.end - alignment, t.lstR ) );		//		ByteBuffer buf = ByteBuffer.allocate ( alignment );		parentApi.read ( t.end - alignment, buf );		t.copyTo ( buf, 0, t.lstR );		//		buf.clear();		parentApi.write ( t.end - alignment, buf );	    }	    break;	case BufferType.ALIGNED:	    mylog ( "writeALGN] " + t.toBlockString ( t.offset, t.length ) );	    //	    parentApi.write ( offset, src );	    break;	default:	    throw new IllegalArgumentException		    ( "no type: shouldn't happen" );	}    }